@busha/commerce-js
v1.0.33
Published
Busha commerce js library
Readme
Busha commerce-js
Receive crypto payments with Busha commerce
Installation
Browser
<script src="https://cdn.jsdelivr.net/npm/@busha/commerce-js/dist/index.min.js"></script>
<script>
const BushaCommerce = window.BushaCommerce
</script>Node
yarn add @busha/commerce-js
# OR
npm i @busha/commerce-jsimport BushaCommerce from "@busha/commerce-js"Usage
const payload = {
reference: `ref_${new Date().getTime()}`, // optional; will be auto-generated if nothing is 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
devMode: true, // optional; defaults to false
onClose: (d) => {
console.log("Payment cancelled!", d)
},
onSuccess: (d) => {
console.log(d)
},
source: "payment-link", // optional
source_id: "18937r13gufbqwe", // optional
paymentMethod: "busha", // optional: skip payment method selection ("busha" | "stablecoins")
}
BushaCommerce(payload)Payment method
Pass paymentMethod to open the checkout directly on a specific payment option instead of showing the payment method selection screen.
| Value | Payment option |
| --- | --- |
| "busha" | Pay with Busha |
| "stablecoins" | Pay with stablecoins (transfer) |
Can't find your public key ?

