basqet-checkout
v0.1.8
Published
Client-side JS library for Basqet
Downloads
118
Readme
Basqet SDK
Basqet SDK is a library to be used on the client (browser) which would help load the Basqet Checkout in order to receive cryptocurrencies from users.
How to install
You can install via npm with:@quidax/basqet-checkout
npm install @quidax/basqet-checkout
Usage
If you intalled the package via npm, you can use it like so:
import payWithBasqet from '@quidax/basqet-checkout';
payWithBasqet({
amount: '5000',
currency: 'NGN',
email: '[email protected]',
public_key: 'pk_test_123',
name: 'John Doe', // optional
description: 'Payment for Sofresh Parfait', //optional
meta: { // any data (meta will be returned with every webhook response)
transaction_reference: 'REF312532412' // sample payload
}, //optional
onSuccess: (ref) => {
alert(`Transaction successful: ${ref}`);
},
onError: (error) => {
alert(`Transaction failed ${error}`);
},
onClose: () => {
alert('Checkout closed');
},
});
But if you installed it via a CDN (like unpkg.com), a payWithBasqet
method will be attached to the window object so you can use it this way:
window.payWithBasqet({
...
})
Need help?
If you have any questions, feel free to reach out to [email protected]