3.1.2 • Published 5 years ago
node-freebe v3.1.2
Freebe
Nodejs API wrapper for Freebe.
Installation
npm install node-freebe
Usage
// Require the library
var freebe = require('node-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
};
freebe.transactions.charge(charge, function(error, body) {
console.log(error);
console.log(body);
});
freebe.subaccounts.getBanks(function(error, body) {
console.log(error);
console.log(body);
});
// Second Option
// freebe.{resource}
freebe.transactions.charge(charge)
.then(function(body) {
console.log(body);
})
.catch(function(error) {
console.log(error);
});
freebe.subaccounts.getBanks()
.then(function(body) {
console.log(body);
})
.catch(function(error) {
console.log(error);
});
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
3.1.2
5 years ago
3.1.1
5 years ago
3.1.0
5 years ago
3.0.111
5 years ago
3.0.10
5 years ago
3.0.9
5 years ago
3.0.8
5 years ago
3.0.7
5 years ago
3.0.6
5 years ago
3.0.5
5 years ago
3.0.4
5 years ago
3.0.3
5 years ago
3.0.2
5 years ago
3.0.1
5 years ago
3.0.0
6 years ago
2.0.2
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago