Package Exports
- eway-rapid
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eway-rapid) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eWAY Rapid Node.js Library
A Node.js library to integrate with eWAY's Rapid Payment API.
Sign up with eWAY at:
- Australia: https://www.eway.com.au/
- New Zealand: https://eway.io/nz/
- UK: https://eway.io/uk/
- Hong Kong: https://eway.io/hk/
- Malaysia: https://eway.io/my/
- Singapore: https://eway.io/sg/
For testing, get a free eWAY Partner account: https://www.eway.com.au/developers
Installation
$ npm install eway-rapidUsage
See the eWAY Rapid API Reference for usage details.
A simple Direct payment example:
var rapid = require('eway-rapid');
var key = '60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR',
password = 'API-P4ss',
endpoint = 'sandbox';
var client = rapid.createClient(key, password, endpoint);
client.createTransaction(rapid.Enum.Method.DIRECT,{
"Customer": {
"CardDetails": {
"Name": "John Smith",
"Number": "4444333322221111",
"ExpiryMonth": "12",
"ExpiryYear": "25",
"CVN": "123"
}
},
"Payment": {
"TotalAmount": 1000
},
"TransactionType": "Purchase"
}).then(function (response) {
if (response.get('TransactionStatus')) {
console.log('Payment successful! ID: ' + response.get('TransactionID'));
}
});Change log
Please see CHANGELOG for more information what has changed recently.
Testing
This library can be tested using npm:
$ npm install
$ npm testIntegration tests can also be run - first copy .env.dist to .env and add your eWAY Sandbox API Key & Password. Then run:
$ npm run test:integrationLicense
The MIT License (MIT). Please see License File for more information.