You can install the component using yarn:
npm install node-wayforpay-library
or
yarn add node-wayforpay-library
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'
})
// ...
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.
generatePurchaseData
: Generate data (JSON) for payment form with signaturegenerateVerifyData
: Generate data (JSON) for card verification form with signature
For detailed information on changes between versions, please refer to our changelog.
This project is licensed under the MIT License.
Viacheslav Angel