3.1.2 • Published 7 years ago
node-freebe v3.1.2
Freebe 
Nodejs API wrapper for Freebe.
Installation
npm install node-freebeUsage
// 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 testIf 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
7 years ago
3.1.1
7 years ago
3.1.0
7 years ago
3.0.111
7 years ago
3.0.10
7 years ago
3.0.9
7 years ago
3.0.8
7 years ago
3.0.7
7 years ago
3.0.6
7 years ago
3.0.5
7 years ago
3.0.4
7 years ago
3.0.3
7 years ago
3.0.2
7 years ago
3.0.1
7 years ago
3.0.0
7 years ago
2.0.2
8 years ago
2.0.1
8 years ago
2.0.0
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago