UPGRADED FROM MPOWER PAYMENT This is an unofficial NodeJs Library for Hubtel. See our wiki for detailed examples.
New Addtions
Online Checkout
Ability to refund Customers
Check status of online transactions
npm i --save hubtelmobilepayment
See Hubtel Documentation for data format. Hubtel Docs Setup Api Keys gotten from hubtel Account.Hubtel Docs
var hubtelpayment = require('hubtelmobilepayment');
var hubtel_pay = new hubtelpayment({
clientid: 'bxd34kou',
secretid: 'rfiz45dm',
merchantaccnumber: 'HM325170009'
})
It is most advicable to put keys in environmental variables (.env) .
After initialization.
var receivedata = {
"CustomerName": "Customer Name",
"CustomerMsisdn": "233264545335",
"CustomerEmail": "[email protected]",
"Channel": "airtel-gh",
"Amount": 0.8,
"PrimaryCallbackUrl": "https://hubtelpayment.herokuapp.com/api/v1/moneycallback", /////example callback
"Description": "T Shirt"
}
hubtel_pay.ReceiveMobileMoney(receivedata).then(function(data) {
console.log(data)
})
See our wiki for detailed examples
HAPPY HACKING โค