Freebe
Nodejs API wrapper for Freebe.
Installation
npm install node-freebe
Usage
// Require the libraryvar freebe = 'secret_key';
Making calls to the resources
The resource methods accepts are promisified, but can receive optional callback as the last argument.
// First Option// freebe.{resource}.{method}let charge = email: 'somunizua@gmail.com' amount: 1000;freebetransactions; freebesubaccounts;
// Second Option// freebe.{resource}freebetransactions ; freebesubaccounts ;
Resources
- transaction
- charge
- subaccount
- getBanks
Contributing
- To ensure consistent code style, please follow the editorconfig rules in .editorconfig
Tests
To run tests, add your Freebe test secret key to package.json
. (The test line should look something like this: env KEY=sk_test_1a68ac96a0171fb72111a24295d8d31d41c28eed ./node_modules/.bin/mocha...
). Now run:
npm test
If you are contributing to the repo, kindly update the necessary test file in /test
or add a new one and ensure all tests are passed before sending a PR.
Todo
- Proper resource examples
- ES6 support