This is intended to be a clean, idiomatic client for the Armor Payments API. This will handle generating the authenticated headers and constructing the properly nested request URI, as well as parsing any response JSON for you.
To install use npm
and add the package to your application's dependencies:
$ npm install armor-payments --save
The Armor Payments API is REST-ish and nested, so the client relies on chaining. We use request-promise to return a Promise for all operations resulting in an API request, with the added nice-ness that we've parsed the JSON response body for you if possible.
var armorPayments = require('armor-payments');
var client = new armorPayments.API('your-key', 'your-secret', shouldUseSandbox);
// There are four top-level resources: accounts, users, orders, and shipmentcarriers
// Querying users and orders requires an accountId
client.accounts().all().then(function (response) {
// response.body contains parsed JSON object
});
Fore more detailed usage examples, See the Ruby client. We follow the same API naming and method chaining conventions with only differences being the usage of camelCase instead of under_scores, and using Promises for handling responses as above.
We use CoffeeScript for development. The source files are under src and the tests are under test. To compile CoffeeScript into JavaScript and run tests, invoke Grunt:
$ grunt
Features branching and release management are handled using git-flow, and active development is always done on the develop branch.
Making a release involves the following steps:
-
Update CHANGELOG.md with relevant changes
-
Create new release branch, for example:
$ git flow release start v0.2.0
-
Bump version:
$ npm version --no-git-tag-version [major|minor|patch|...]
-
Commit and finalize release, and push to remote:
$ git commit -a -m "bumped version for release" $ git flow release finish v0.2.0 $ git push --all $ git push --tags
-
Push to NPM:
$ npm publish
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
Find this project useful? Help us make it even better by submitting any bugs or improvement suggestions you have as GitHub Issues and Pull Requests.
Like what we're doing? There's much more Node.js and CoffeeScript goodness where this came from! drop us a line if you wanna chat about potential career opportunities at Globality: careers at globality dot com
MIT License. See accompanying LICENSE.txt file.