114
loading...
This website collects cookies to deliver better user experience
HTML
link in the TOC to skip to the code base.env
file and insert them in your .gitignore
to prevent it from being pushed to the public. (Safety Second 🔐) because secret keys can perform any API request to Flutterwave without restriction. <script>
const form = document.getElementById("payForm");
form.addEventListener("submit", makePayment);
function makePayment() {
FlutterwaveCheckout({
public_key: "*******_TEST-********************************-X",
tx_ref: "ay_" + Math.floor((Math.random() * 1000000000) + 1),
amount: document.getElementById("amount").value,
currency: "NGN",
customer: {
email: document.getElementById("email").value,
phonenumber: document.getElementById("phoneNumber").value,
name: document.getElementById("fullName").value
},
callback: function (data) {
console.log(data);
const reference = data.tx_ref;
alert("payment was successfully completed" + reference)
},
customizations: {
"title": "Wonderful Direct pharmacy",
"description": "payment integration",
"logo": "https://image.flaticon.com/icons/png/512/809/809957.png"
}
});
}
</script>
make payment
button.