fastpay

1.1.0 • Public • Published

node-fastpay

NPM version Build Status Dependency Status Coverage Status

FastPay for Node.js.

Getting started

Install via 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);
    }
});

Create a charge

fastpay("YOUR_API_KEY").create({
    amount: 1000,
    card: "YOUR_CARD_ID"
}, function (err, res, body) {
    if (!err && res.statusCode === 200) {
        console.log(body);
    }
});

Retrieve a charge

fastpay("YOUR_API_KEY").retrieve("YOUR_CHARGE_ID", function (err, res, body) {
    if (!err && res.statusCode === 200) {
        console.log(body);
    }
});

Refund a charge

fastpay("YOUR_API_KEY").refund("YOUR_CHARGE_ID", function (err, res, body) {
    if (!err && res.statusCode === 200) {
        console.log(body);
    }
});

Capture a charge

fastpay("YOUR_API_KEY").capture("YOUR_CHARGE_ID", function (err, res, body) {
    if (!err && res.statusCode === 200) {
        console.log(body);
    }
});

Retrieve all charge

fastpay("YOUR_API_KEY").all({
    count: 1
}, function (err, res, body) {
    if (!err && res.statusCode === 200) {
        console.log(body);
    }
});

More details to use FastPay

All the stuff in FastPay official documents.

Testing

npm test runs liting and testing scripts.

$ npm install
$ npm test

Finally the code coverage report will be generated.

Contributing

See the CONTRIBUTING.md.

Author

Ryuichi Okumura

License

This module is available under the BSD license.

The request module is available under the Apache License 2.0.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i fastpay

Weekly Downloads

1

Version

1.1.0

License

BSD

Last publish

Collaborators

  • okuryu