vfd-react-widget
v1.0.2
Published
JS library for implementing the VFD payment widget - This library provides a front-end web SDK for account authentication and payment for each bank that it supports.
Downloads
17
Maintainers
Readme
V Payment Widget
JS library for implementing the VFD payment widget - This library provides a front-end web SDK for account authentication and payment for each bank that it supports.
Installing
Using npm:
npm i vfd-react-widget
Using yarn:
yarn add vfd-react-widget
Usuage
For JS frameworks import it and use
import VPaymentWidget from 'vfd-react-widget';
const widget = await VPaymentWidget.loadWidget();
const widgetLaunch = new widget({
token: '', // Your token
merchantId: '', // Merchant Id
environment: '', // Environment at which the app is running development/production,
logo: '', // the url of your logo
email: '', // email of the user making payment
onSuccess: () => void // callback to notify you of successful payment
});
async function payNow(amount) {
widgetLaunch.pay({
amount, // amount to pay
});
}
The example above will launch the widget.
VPaymentWidget Options
| Props | description | Required | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | | token | You will get this from your merchant dashboard | true | | merchantId | Unique merchantID | true | | environment | Use development when integrating, when you are ready to go live, you can change this to production. You can use an environment variable to save this. | true | | logo | This should be the url of your logo | false | | email | The email of the user making payment | true | | onSuccess | This will call the function you have specified when a payment is successful. it will call your call back function with ({method, reference}) | false |
Other information
For enquires and questions, contact