1.0.2 • Published 1 year ago

vfd-react-widget v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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.

Landing Screen

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

PropsdescriptionRequired
tokenYou will get this from your merchant dashboardtrue
merchantIdUnique merchantIDtrue
environmentUse 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
logoThis should be the url of your logofalse
emailThe email of the user making paymenttrue
onSuccessThis 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

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.2.32

1 year ago

0.2.31

1 year ago