SecureNet PayOS API community library for Node.js. All features and commands of the SecureNet PayOS API payment gateway are supported. SecureNet is a WorldPay company.
- Credit Card Present
- Credit Card Not Present
- ACH
- Settlement
- Credits
- Refunds
- Voids
- SecureNet Vault
- Recurring Billing
- Transaction Reporting and Management
- Tokenization
- For unit testing purposes.
- For browser tokenization see PayOS.js.
npm install securenet-js --save
The following features are supported:
- Multiple client instances.
- Can change mode between live and sandbox.
- At initialization of the client.
- All PayOS API features and commands are supported.
- Fully unit tested.
Initialize the payment gateway client:
var config = {
credentials: {
secureNetId: ' your SecureNet Id ', //provided via signup email
secureNetKey: ' your SecureNet secure Key ' //provided inside virtual terminal
},
developerApplication: {
developerId: 12345678, // provided by SecureNet after certification
version: '1.2'
},
mode: 'live' //live or test
};
var SecureNet = require('securenet');
var payos = new SecureNet(config);
See the unit tests for common application workflows.
We are using Mocha for unit testing.
The unit test spec requires you to set your api credentials as environment variables.
export SECURENET_ID=xxxx
export SECURENET_SECURE_KEY=yyyy
Install with npm:
$ npm install -g mocha
$ npm install -g chai
Run unit tests:
$ npm test
$ npm install istanbul -g
$ istanbul cover _mocha
npm install -g eslint
eslint .
I have identified the following feature limitations with SecureNet's payment gateway.
-
During tokenization if an error occurs their documentation indicates the response parameters will return
resultType
. However, during testing on the sandbox their api only seemed to return 'BAD_REQUEST' which does not allow for field specific error messages. -
During tokenization you can immediately save the customer and payment method into the vault (addToVault = true). However, if the customer or the payment method fail to be saved in the vault the response parameters will return success = true. You need to look for the presence of the customerId and paymentMethodId in order to confirm the customer and payment method was saved in the vault. Their is no error message return in this case to indicate why the customer or payment method was not saved in the vault. This makes messaging to the end user difficult.
The reason for this is because SecureNet does not perform any validation of the PCI payment method when saving to the vault. However, SecureNet does perform validation when saving to the vault. Therefore, the user's payment method may fail vault vaildation.
The original author of securenet-node is Richard Stanford.
The current lead maintainer is Dan Hollenbeck.