SkillAgentSearch skills...

HubtelMobilePayment

A library for Easy Communication with Hubtel Payment Gateway

Install / Use

/learn @banphlet/HubtelMobilePayment
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Build Status Known Vulnerabilities Greenkeeper badge

HubtelMobilePayment

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

New Additions

  • [X] Online Checkout
  • [X] Ability to refund Customers
  • [X] 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

| FIELD | TYPE | REQUIRED | DESCRIPTION | |----------|-------------|-------------|---------------------------| |clientid | String | yes | clientid obtained from hubtel| | secretid | String | yes | secretid obtained from hubtel | |merchantaccnumber | String | yes | The 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 ❤

View on GitHub
GitHub Stars7
CategoryDevelopment
Updated1y ago
Forks1

Languages

JavaScript

Security Score

70/100

Audited on Dec 30, 2024

No findings