Tools to integrate PonchoPay on NodeJS
npm install @ponchopay/pp-nodejsTools to integrate PonchoPay on NodeJS
Install it from npm:
``bash`
npm i @ponchopay/pp-nodejs
You can also use your favourite package manger like yarn or pnpm.
This package declares the following functions:
- createToken: This function allows the creation of tokens for the initialisation endpoints.
- createJWT: This function allows the creation of JWTs for the payment manipulation endpoints.
- isValidCallback: Verifies that a request from Poncho does indeed come from Poncho and hasn't been tampered in any way.
- parseCallback: Securely parses a callback received from Poncho only if the callback is verified to come from Poncho.
And the Client class which provides the following methods:
- validateLocationUrn: This method allows to validate a location to ensure it is ready to process payments.
- initiatePayment: This method allows to initialise a payment in PonchoPay.
- initiateSubscription: This method allows to initialise a subscription in PonchoPay.
- updatePaymentMethod: This method allows to change the Payment Method properties.
- refundPaymentMethod: This method allows to fully or partially refund a Payment Method.
- cancelPayment: This method allows to cancel a Payment.
- cancelRecursion: This method allows to cancel a Recurring Payment.
To scan the project for linting and formatting errors, run
`bash`
npm run lint
To automatically fix linting and formatting errors, run
`bash`
npm run format
To ensure the project is bug-free, run
`bash``
npm run test