Receive crypto payments with Busha commerce
<script src="https://cdn.jsdelivr.net/npm/@busha/[email protected]/dist/index.min.js"></script>
<script>
const BushaCommerce = window.BushaCommerce;
</script>yarn add @busha/commerce-js
# OR
npm i @busha/commerce-jsimport BushaCommerce from "@busha/commerce-js";const payload = {
reference: `ref_${new Date().getTime()}`, // optional, will be auto-generated if nothing's passed
public_key: "[YOUR PUBLISHABLE KEY]",
quote_amount: "2000", // required: amount to charge
quote_currency: "NGN", // required: currency for the quote amount (e.g., "NGN", "USD")
target_currency: "NGN", // required: target currency
source_currency: "NGN", // required: source currency
callback_url: "https://your-domain.com/callback", // optional: webhook callback URL
meta: { email: "[email protected]", name: "Busha" }, // optional: customer info
onClose: (d) => {
console.log("Payment cancelled!", d);
},
onSuccess: (d) => {
console.log(d);
},
};
BushaCommerce(payload);Can't find your public key ?
