2.1.0 • Published 6 years ago

hubtelmobilepayment v2.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Build Status Known Vulnerabilities

HubtelMobilePayment

UPGRADED FROM MPOWER PAYMENT This is an unofficial NodeJs Library for Hubtel. See our wiki for detailed examples.

New Additions

  • Online Checkout
  • Ability to refund Customers
  • Check status of online transactions

Installation

npm i --save hubtelmobilepayment

API configuration

See Hubtel Documentation for data format. Hubtel Docs Setup Api Keys gotten from hubtel Account.Hubtel Docs

Required Parameters

FIELDTYPEREQUIREDDESCRIPTION
clientidStringyesclientid obtained from hubtel
secretidStringyessecretid obtained from hubtel
merchantaccnumberStringyesThe merchant number obtained from hubtel

It is most advicable to put keys in environmental variables (.env).

Initialize hubtel instance

  const hubtelpayment = require('hubtelmobilepayment');
  const hubtel_pay = new hubtelpayment({
  clientid: 'bxd34kou',
  secretid: 'rfiz45dm',
  merchantaccnumber: 'HM325170009'
  }) 

Receive Mobile Money

After initialization.

const receivedata = {
"CustomerName": "Customer Name",
"CustomerMsisdn": "233264545335",
"CustomerEmail": "customeremail@gmail.com",
"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

Test

npm test

HAPPY HACKING ❤

2.1.0

6 years ago

2.0.9

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.3

6 years ago

2.0.4

6 years ago

2.0.2

6 years ago

2.0.1

7 years ago

2.0.0

7 years ago