hubtel 0.1.1

Hubtel mobile money payment API

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Hubtel Mobile Payment

This is an unofficial Hubtel Merchant API for D. It's also available as a package in the Dub package registry.


Using Dub, you may add hubtel as dependency in your dub.json file and the package will be downloaded automatically during project build if it's not downloaded already.

    "dependencies": {
        "hubtel-d": "~>0.1.0"

You may also fetch the latest version manually with the command-line using the dub:

dub fetch hubtel

API configuration

The hubtel.config.Config struct is used to configure API keys. Substitute information provided below with your own account information. Check the Hubtel Merhcant API Documentation for more infomation.

From a security standpoint, it much safer store your merhcant account API keys and other confidential in environmental variables instead of hard-coding them in your source code.

import hubtel.config: Config;
import hubtel.merchant: MobileMoney;
import std.stdio: writeln;

string userSendData = 
        "RecipientName": "John Doe",
        "RecipientMsisdn": "233264545335",
        "CustomerEmail": "",
        "Channel": "airtel-gh",
        "Amount": 4.00,
        "PrimaryCallbackUrl": "" ,
        "SecondaryCallbackUrl": "",
        "Description": "Ordered 2 packages of waakye",
        "ClientReference": "10652132"

string userReceiveData = 
        "CustomerName": "Mary Doe",
        "CustomerMsisdn": "233264545335",
        "CustomerEmail": "",
        "Channel": "airtel-gh",
        "Amount": 7.50,
        "PrimaryCallbackUrl": "",
        "Description": "Bowl of Gari"

void main()
    MobileMoney pay = MobileMoney(config);

    // Sending payment
    auto sendResult = pay.send(userSendData);
    if (sendResult.error)
        //Take appropriate action here
        string errorMessage = sendResult.response;

    //Connection went through. Use response to determine what happended

    // Recieving payment
    auto receiveResult = pay.receive(userReceiveData);
     if (receiveResult.error)
        //Take appropriate action here
        string errorMessage = receiveResult.response;

    //Connection went through. Use response to determine what happended


  • Create data schema payment send and receive
  • Improve code test coverage
    • contract for send() and receive()`
    • API call response ??
    • Config()
  • Improve API documentation
  • Lawrence Aberba
0.1.3 2017-Jul-25
0.1.2 2017-Jul-22
0.1.1 2017-Jul-22
0.1.0 2017-Jul-22
~master 2018-Jan-09
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 7 downloads total

Short URL: