paya
v1.1.0
Published
Node module for the Paya payment API.
Downloads
10
Maintainers
Readme
Paya
This project is an open source node module for the Paya REST API.
Installation
npm install -g paya
npm install --save paya
Getting Started
In order to call the Paya API, you will need to be setup with:
- client id
- client secret
- merchant id
- merchant key
const PayaClient = require('paya');
const client = new PayaClient({
clientId,
clientSecret,
merchantId,
merchantKey,
});
Methods
ach.postCharges(data)
Used to process a charge / Sale transactions in a single request.
const response = await client.ach.postCharges({
secCode: '',
amounts: {
total: 0,
},
account: {
type: '',
routingNumber: '',
accountNumber: '',
},
billing: {
name: {
first: '',
last: '',
},
address: '',
city: '',
state: '',
postalCode: '',
},
}));
ach.getCharges(query)
Used to query charges by various criteria including amount, date, order number, type, etc. Results include both summarized information and itemized detail.
const response = await client.ach.getCharges({
startDate: '',
endDate: '',
pageSize: 0,
pageNumber: 0,
sortDirection: '',
sortField: '',
name: '',
accountNumber: '',
source: '',
oderNumber: '',
reference: '',
batchReference: '',
totalAmount: 0,
}));
ach.postTokens(data)
Used to store an account and retrieve a vault token. A vault token allows you to process a charge or credit without knowing the Routing number and Account number.
const response = await client.ach.postTokens({
account: {
type: '',
routingNumber: '',
accountNumber: '',
});
});
ach.putToken(tokenId, data)
Used to update the account data associated with a vault token.
const response = await client.ach.putToken(tokenId, {
account: {
type: '',
routingNumber: '',
accountNumber: '',
});
});
ach.deleteToken(tokenId)
Used to delete a vault token.
const response = await client.ach.deleteToken(tokenId);
Contribution Guidelines
We recommend using nvm to manage node versions. This project was created using 12.13.0.
Fork the respository and install all the dependencies:
npm install
Run the npm setup script in the project root directory:
npm run setup
Make sure to run the unit tests and linting before committing. Obviously, add to the tests as you make changes:
npm run test
For watch:
npm run test:watch
You can also run the scenario tests against the live API:
npm run test-scenario