1.1.0 • Published 4 months ago

@ponchopay/pp-nodejs v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

pp-nodejs

Tools to integrate PonchoPay on NodeJS

Installation

Install it from npm:

npm i @ponchopay/pp-nodejs

Usage

This package declares 2 objects:

createToken: function

Importing:

import { createToken } from '@ponchopay/pp-nodejs';

Parameters:

ParameterMandatoryTypeDescription
keyYesstringIntegration key
metadataYesstringAny string you want to keep saved within the payment

Returns: It returns an string containing the token to be used to initate a payment

Client: class

Importing:

import { Client } from '@ponchopay/pp-nodejs';

Constructor:

ParameterMandatoryTypeDescription
keyYesstringIntegration key
baseNostringBase PonchoPay URL to use. Default: https://pay.ponchopay.com/

Methods:

initiatePayment:

Parameters:

ParameterMandatoryTypeDescription
initYesobjectPayment initialisation object

The payment initialisation object is defined as follows:

ParameterMandatoryTypeDescription
metadataYesstringAny string you want to keep saved within the payment
urnYesstringThe Unique Reference Number
amountYesnumberThe payable amount in pences
emailYesstringThe user email
noteNostringAny note to be attached to the payment
expiryNoDate or stringThe date you want the payment to expire

Returns: It returns the URL the user needs to use to make the payment.

Development

Linting and formatting

To scan the project for linting and formatting errors, run

npm run lint

To automatically fix linting and formatting errors, run

npm run format

Testing

To ensure the project is bug-free, run

npm run test
1.1.0

4 months ago

1.0.1

8 months ago

1.0.0

8 months ago