PHPackages                             thulani/airtel-money-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. thulani/airtel-money-php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

thulani/airtel-money-php-sdk
============================

Airtel Money SDK for collection, disbursement and remmittance.

31381PHP

Since Apr 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/thulanirex/airtel-money-php-sdk)[ Packagist](https://packagist.org/packages/thulani/airtel-money-php-sdk)[ RSS](/packages/thulani-airtel-money-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

#### AirtelMoneyPhpSdk

[](#airtelmoneyphpsdk)

This is a PHP library for integrating with the Airtel Money Africa API.

### Requirements

[](#requirements)

```
PHP 7.4 or higher
GuzzleHttp PHP library
PHP dotenv library

```

### Installation

[](#installation)

You can install the package via composer:

composer require thulani/airtel-money-php-sdk

### Usage

[](#usage)

Authorisation
-------------

[](#authorisation)

Before you can make any API calls, you need to authorize your app:

$airtelMoney-&gt;authorize();

By default, this method will use the client ID and client secret provided when creating the AirtelMoney instance to obtain an access token using the client credentials grant. If you already have an access token, you can pass it as an argument:

$airtelMoney-&gt;authorize('your-access-token');

You can also provide a callback function that will be called after the access token is obtained:

$airtelMoney-&gt;authorize(null, function ($token) { // Do something with the token });

AirtelCollection Class
----------------------

[](#airtelcollection-class)

The AirtelCollection class provides methods for initiating a push request, requesting a refund, querying transaction status and processing reconciliations.

Initialize the class
====================

[](#initialize-the-class)

use Thulani\\AirtelMoneyPhpSdk\\AirtelCollection;

$config = \[ 'client\_id' =&gt; 'your-client-id', 'client\_secret' =&gt; 'your-client-secret', 'public\_key' =&gt; 'your-public-key', 'currency' =&gt; 'your-currency-code', 'country' =&gt; 'your-country-code', 'env' =&gt; 'staging' // or 'production' \];

$airtel = new AirtelCollection($config);

Initiate USSD Push
==================

[](#initiate-ussd-push)

initiateUssdPush($amount, $phoneNumber, $transactionId = null, $transactionRef = null, $currency = null, $country = null, $callback = null)

This method initiates an USSD push request.

$amount = 50; $phoneNumber = '712345678'; $transactionRef = 'trx-ref-1234'; // optional $transactionId = 'trx-id-1234'; // optional $currency = 'ZMW'; // optional $country = 'ZM'; // optional

$result = $airtel-&gt;initiateUssdPush($amount, $phoneNumber, $transactionId, $transactionRef, $currency, $country);

// If you want to pass in a callback function $airtel-&gt;initiateUssdPush($amount, $phoneNumber, $transactionId, $transactionRef, $currency, $country, function($result) { // Handle response });

Request Refund
==============

[](#request-refund)

try { $response = $airtelCollection-&gt;requestRefund( $transactionId, $country, $currency, function ($result) { // Do something with the result } ); } catch (\\Exception $e) { // Handle error }

Query transaction Status
========================

[](#query-transaction-status)

try { $response = $airtelCollection-&gt;queryTransactionStatus( $transactionId, $country, $currency, function ($result) { // Do something with the result } ); } catch (\\Exception $e) { // Handle error }

Process Reconcilliation
=======================

[](#process-reconcilliation)

$payload = '{"transaction": {"status": "SUCCESS", "transaction\_reference": "abc123", "transaction\_id": "12345", "msisdn": "26077XXXXXXX", "amount": "5000", "currency": "ZMW", "channel": "AIRTELMM", "narrative": "Payment for goods"}}';

$result = $airtelCollection-&gt;processReconciliation($payload, function ($transaction) { // Do something with the transaction });

Airtel Disbursement
-------------------

[](#airtel-disbursement)

use Thulani\\AirtelMoneyPhpSdk\\AirtelDisbursement;

// Your Airtel API credentials and other configuration options $config = \[ 'client\_id' =&gt; 'your\_client\_id', 'client\_secret' =&gt; 'your\_client\_secret', 'public\_key' =&gt; 'your\_public\_key', 'currency' =&gt; 'ZMW', 'country' =&gt; 'ZM', 'env' =&gt; 'production', \];

// Initialize the AirtelDisbursement object with the config options $airtelDisbursement = new AirtelDisbursement($config);

// Authorize using the authorize() method inherited from the AirtelService class $airtelDisbursement-&gt;authorize();

// Call the initiateDisbursement() method $phoneNumber = '2547xxxxxxxx'; $amount = 100; $transactionRef = 'ABC123'; $result = $airtelDisbursement-&gt;initiateDisbursement($phoneNumber, $amount, $transactionRef);

// Use the $result as needed

CallBacks
---------

[](#callbacks)

You can pass a callback function to any method to handle the response data.

function handleResponse($result) { // handle result data }

$result = $collection-&gt;initiateUssdPush($amount, $phoneNumber, $transactionId, $transactionRef, $currency, $country, 'handleResponse');

### Licence

[](#licence)

The MIT License (MIT). Please see License File for more information.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/94fedefabd1fc2c94a560d501a2ec5baa2dc3169205424d91fad245d0e05fa41?d=identicon)[thulanirex](/maintainers/thulanirex)

### Embed Badge

![Health badge](/badges/thulani-airtel-money-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/thulani-airtel-money-php-sdk/health.svg)](https://phpackages.com/packages/thulani-airtel-money-php-sdk)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
