Vanilla JS
Integrate Bani payment widget using pure JavaScript
When you have all the details needed to initiate the transaction, the next step is to tie them to the JavaScript function that passes them to Bani and displays the Bani Pop Widget.
Important notes
The merchantKey field here takes your Bani public key.
The amount field holds the total amount to pay.
The merchantRef field is a custom unique reference passed by the merchant. This is optional
The callback method is called when payment has been completed. See here for more information.
The onClose method is called if the user closes the widget. See here for more information.
It’s recommended to make use of the webhook notifications to verify all incoming payments. You can however verify payment status via API. See here for more information
If you need integrate payment collection via API, you can find API integration details here.
Last updated