WIP
Hello Cash API NodeJS Client
Requires NodeJS 8+
npm install hellocash-node --save
You need the following before getting to use this library:
- Password
- Internal user id, phone number or agent id.
const HelloCash = require('hellocash-node')
const helloCash = new HelloCash();
await helloCash.authenticate({
principal: '251xxxxxxxxx',
credentials: 'password',
system: 'lucy'
});
let res = await helloCash.airtimeTransfer({
amount: 100,
to: '251xxxxxxxxxxx'
});
Authenticate a user with username and password. Returns a Bearer API token. The API token must be passed as header with Authorization: Bearer on all subsequent accesses to the api.
let authInfo = await helloCash.authenticate({
principal: '251xxxxxxxxx',
credentials: 'password',
system: 'lucy'
});
Change a user's password. Returns a Bearer API token on successful change.
await helloCash.password({
principal: '251xxxxxxxxx',
old_password: 'old',
new_password: 'new',
system: 'lucy'
});
Finds a list of accounts visible.
let accounts = await helloCash.visibleAccounts();
Find an accounts .
let account = await helloCash.findAccount('xxxxxxxxxxxxxxx');
Create a new Airtime transfer. The Airtime transfer will be attempted and may have several possible states.
let res = await helloCash.airtimeTransfer({
amount: 100,
to: '251xxxxxxxxxxx'
});
Validate if an airtime topup can be made.
let res = await helloCash.validateAirtime({
amount: 100,
to: '251xxxxxxxxxxx'
});
Returns a list of amonts, which are currently available topup amounts in the system.
let amounts = await helloCash.airtimeAmounts();
Finds a list of airtime transfers to and from this account.
let amounts = await helloCash.airtimeTransfers({
offset: 10,
limit: 100,
status: 'PREPARED'
});
MIT