FastPay for Node.js.
Install to using NPM.
$ npm install fastpay
All functions of fastpay
object passes the data via callbacks.
Callbacks has the error and response data via the request module.
var fastpay = require("fastpay");
fastpay("YOUR_API_KEY", function (err, res, body) {
if (!err && res.statusCode === 200) {
console.log(body);
}
});
fastpay("YOUR_API_KEY").create({
amount: 1000,
card: "YOUR_CARD_ID"
}, function (err, res, body) {
if (!err && res.statusCode === 200) {
console.log(body);
}
});
fastpay("YOUR_API_KEY").retrieve("YOUR_CHARGE_ID", function (err, res, body) {
if (!err && res.statusCode === 200) {
console.log(body);
}
});
fastpay("YOUR_API_KEY").refund("YOUR_CHARGE_ID", function (err, res, body) {
if (!err && res.statusCode === 200) {
console.log(body);
}
});
fastpay("YOUR_API_KEY").capture("YOUR_CHARGE_ID", function (err, res, body) {
if (!err && res.statusCode === 200) {
console.log(body);
}
});
fastpay("YOUR_API_KEY").all({
count: 1
}, function (err, res, body) {
if (!err && res.statusCode === 200) {
console.log(body);
}
});
All the stuff in FastPay official documents.
npm test
runs liting and testing scripts.
$ npm install
$ npm test
Finally the code coverage report will be generated.
See the CONTRIBUTING.md.
- Ryuichi Okumura (@okuryu)
This module is available under the BSD license.
The request module is available under the Apache License 2.0.