balance-api-skanetrafiken
v0.1.0
Published
balance.io api for Skånetrafiken's Jojo Reskassa
Downloads
3
Readme
balance-api-skanetrafiken
balance.io api client for Skånetrafiken's Jojo Reskassa. Works in node and in the browser (using browserify).
Installation
via npm:
$ npm install balance-api-skanetrafiken --save
API
/**
* A simple api client for Skånetrafiken's Jojo Reskassa.
*
* @param {Object} options - The options object containing the credentials used
* when authenticating against Skåntetrafiken.
* @param {String|Number} options.cardNumber - The card number used when
* authenticating.
* @param {String} options.cvc - The card CVC code used when authenticating.
* @param {Skanetrafiken~callback} callback - The callback function.
*/
require('balance-api-skanetrafiken')({
cardNumber: 12345678987,
cvc: 'ABC1'
}, function (error, accounts) {
/**
* @callback Skanetrafiken~callback
* @param {Error|Null} error - An error that you can throw, or null.
* @param {Object[]} [accounts] - An array of account objects.
* @param {String} accounts[].name - The name of the account.
* @param {Number} accounts[].amount - The amount on the account.
*/
if (error) throw error;
console.log('accounts', accounts);
});
License
MIT