PHPackages                             osenco/airtel - 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. osenco/airtel

ActiveLibrary[Payment Processing](/categories/payments)

osenco/airtel
=============

Intuitive and Comprehensive M-PESA SDK for PHP Applications. Just Plug 'N Play

301327[2 issues](https://github.com/osenco/airtel/issues)[1 PRs](https://github.com/osenco/airtel/pulls)PHP

Since Aug 2Pushed 4y ago2 watchersCompare

[ Source](https://github.com/osenco/airtel)[ Packagist](https://packagist.org/packages/osenco/airtel)[ RSS](/packages/osenco-airtel/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Airtel Money API PHP SDK
========================

[](#airtel-money-api-php-sdk)

Airtel Money API PHP SDK

Installation
------------

[](#installation)

```
composer require osenco/airtel
```

Collection APIs
---------------

[](#collection-apis)

### Instantiate

[](#instantiate)

```
use Osen\Airtel\Collection;

$collectAPI = new Collection(
    array(
        'env'           => 'live',
        'client_id'     => 'YOUR_CLIENT_ID',
        'client_secret' => 'YOUR_CLIENT_SECRET',
        'public_key'    => 'YOUR_PUBLIC_KEY',
        'country'       => 'Transaction Country Code e.g KE',
        'currency'      => 'Transaction Currency Code e.g KES'
    )
);
```

### STK/USSD Push

[](#stkussd-push)

```
$collectAPI->authorize()->ussdPush($phone, $amount);
```

Note : Do not send country code in phone number.

You can pass a token to the authorize method if you have a caching mechanism instead of creating a new one each time. You can pass a second argument that is a callback function that updates your token

```
$token = ''; // Get your token from database, redis or whichever cache you use.
$collectAPI->authorize($token, function($newToken) {
    print($newToken);
    // Save/update $newToken in your database
})->ussdPush($phone, $amount);
```

Disbursement APIs
-----------------

[](#disbursement-apis)

```
use Osen\Airtel\Disbursement;

$disburseAPI = new Disbursement(
    array(
        'env'           => 'live',
        'client_id'     => 'YOUR_CLIENT_ID',
        'client_secret' => 'YOUR_CLIENT_SECRET',
        'public_key'    => 'YOUR_PUBLIC_KEY',
        'country'       => 'Transaction Country Code e.g KE',
        'currency'      => 'Transaction Currency Code e.g KES'
    )
);
```

Then send the money

```
$disburseAPI->authorize()->send($phone, $amount);
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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/1e4a04231f4571a99a35c6e8acb096b5cfd7a28eb73b71e026f2024f353fdaca?d=identicon)[maukoese](/maintainers/maukoese)

---

Top Contributors

[![maukoese](https://avatars.githubusercontent.com/u/14233942?v=4)](https://github.com/maukoese "maukoese (10 commits)")

---

Tags

airtelmoneypaymentssdk

### Embed Badge

![Health badge](/badges/osenco-airtel/health.svg)

```
[![Health](https://phpackages.com/badges/osenco-airtel/health.svg)](https://phpackages.com/packages/osenco-airtel)
```

###  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)
