0.1.4 • Published 3 months ago
node-wayforpay-library v0.1.4
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';
// Init api
const wfp = new WayForPayAPI({ merchantAccount, merchantPassword })
// Check status
const response = await wfp.regularPayments.status('ORDER_REFERENCE')
// Create payment
const payment = await wfp.regularPayments.create({
regularMode: 'weekly', // once, daily, quarterly, weekly, monthly, halfyearly, yearly
amount: '100',
dateBegin: 'DD.MM.YYYY',
dateEnd: 'DD.MM.YYYY',
orderReference: 'ORDER_REFERENCE',
email: 'CLIENT_EMAIL'
})
// ...
Regular Payment methods
create
: Create regular paymentstatus
: Check regular payment statussuspend
: To suspend the possibility of recurrent payments from the card, the merchant may pause the payment.resume
: In order to resume previously suspended recurrent paymentchange
: Change regular payment.
Purchase methods
generatePurchaseData
: Generate data (JSON) for payment form with signaturegenerateVerifyData
: 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