<script src="https://checkout.flutterwave.com/v3.js"></script>
<form>
<div>
Your order is ₦2,500
</div>
<button type="button" id="start-payment-button" onclick="makePayment()">Pay Now</button>
</form>
<script>
function makePayment() {
FlutterwaveCheckout({
public_key: "FLWPUBK_TEST-02b9b5fc6406bd4a41c3ff141cc45e93-X",
tx_ref: "txref-DI0NzMx13",
amount: 2500,
currency: "NGN",
payment_options: "card, banktransfer, ussd",
meta: {
source: "docs-inline-test",
consumer_mac: "92a3-912ba-1192a",
},
customer: {
email: "test@mailinator.com",
phone_number: "08100000000",
name: "Ayomide Jimi-Oni",
},
customizations: {
title: "Flutterwave Developers",
description: "Test Payment",
logo: "https://checkout.flutterwave.com/assets/img/rave-logo.png",
},
callback: function (data){
console.log("payment callback:", data);
},
onclose: function() {
console.log("Payment cancelled!");
}
});
}
</script>
body {
font-size: 14px;
font-family: "Moderat","Inter",sans-serif;
font-weight: 400;
color: #333;
}
#start-payment-button {
cursor: pointer;
position: relative;
background-color: #ff9b00;
color: #12122c;
max-width: 30%;
padding: 7.5px 16px;
font-weight: 500;
font-size: 14px;
border-radius: 4px;
border: none;
transition: all .1s ease-in;
vertical-align: middle;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.