
WayForPay nodejs library
Installation
You can install the component using yarn:
npm install node-wayforpay-library
or
yarn add node-wayforpay-library
Usage
import WayForPayAPI from 'node-wayforpay-library';
const merchantAccount: string = 'YOUR_MERCHANT_ACCOUNT';
const merchantPassword: string = 'YOUR_MERCHANT_PASSWORD';
const wfp = new WayForPayAPI({ merchantAccount, merchantPassword })
const response = await wfp.regularPayments.status('ORDER_REFERENCE')
const payment = await wfp.regularPayments.create({
regularMode: 'weekly',
amount: '100',
dateBegin: 'DD.MM.YYYY',
dateEnd: 'DD.MM.YYYY',
orderReference: 'ORDER_REFERENCE',
email: 'CLIENT_EMAIL'
})
Regular Payment methods
create
: Create regular payment
status
: Check regular payment status
suspend
: To suspend the possibility of recurrent payments from the card, the merchant may pause the payment.
resume
: In order to resume previously suspended recurrent payment
change
: Change regular payment.
Purchase methods
generatePurchaseData
: Generate data (JSON) for payment form with signature
generateVerifyData
: Generate data (JSON) for card verification form with signature
Changelog
For detailed information on changes between versions, please refer to our changelog.
License
This project is licensed under the MIT License.
Author
Viacheslav Angel