PHPackages                             say7ama/mpesa\_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. say7ama/mpesa\_sdk

ActiveSdk[Payment Processing](/categories/payments)

say7ama/mpesa\_sdk
==================

Software Development Kit for mpesa api payments for laravel

v1.5(2y ago)11302MITPHPPHP ^7.3|^8.0

Since Jul 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Klayton258/MpesaSdk)[ Packagist](https://packagist.org/packages/say7ama/mpesa_sdk)[ RSS](/packages/say7ama-mpesa-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (8)Used By (0)

M-Pesa SDK, PHP, Laravel
========================

[](#m-pesa-sdk-php-laravel)

Software Development Kit for mpesa api payments for laravel

[![Release](https://camo.githubusercontent.com/d4ad267fa892ebf89e827672bc56c4bf7834aa49b8d16988ffa1ad22ca1b2dcc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f4b6c6179746f6e3235382f4d7065736153646b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Klayton258/MpesaSdk/releases)[![Issues](https://camo.githubusercontent.com/5a0c6567d44484667edfc993aaf096b6cbc5741362a260f5b374bef507570fc9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f4b6c6179746f6e3235382f4d7065736153646b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Klayton258/MpesaSdk/issues)[![Total Downloads](https://camo.githubusercontent.com/944553506bfd839506e24c22103278f640102866ed3d4fc496bcfab4fc855c14/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73617937616d612f6d706573615f73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/say7ama/mpesa_sdk/stats)

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

[](#installation)

Install using composer:

```
composer require say7ama/mpesa_sdk
```

Usage
-----

[](#usage)

1. Add `Say7ama\MpesaSdk\MpesaServiceProvider::class` in `config/app.php`.
2. Use the command to publish the configuration file `Say7ama\MpesaSdk\MpesaServiceProvider::class`.

```
php  artisan vendor:publish
```

3. Open `config/mpesa.php` file and add the require credentials as supplied by M-Pesa Developer Portal.
4. If laravel not recognize the package configuration run:

```
php artisan optimize
```

5. Initiat transactions using:

```
use Say7ama\MpesaSdk\Http\Transactions\MpesaTransactions;

$mpesa = new MpesaTransactions();
```

6. Choose the transaction type and pass the require params:

- Transaction C2B Paymant (Customer to Business):

```
    $data =[
        'from' => $from,                // Customer MSISDN with prefix code '258'
        'reference' => $reference,      // Third Party Reference
        'transaction' => $transaction,  // Transaction Reference
        'amount' => $amount             // Amount
    ];

    $result = $mpesa->C2BPayment($data);
```

- Transaction B2C Paymant (Business to Customer):

```
    $data =[
        'to' => $from,                // Customer MSISDN with prefix code '258'
        'reference' => $reference,      // Third Party Reference
        'transaction' => $transaction,  // Transaction Reference
        'amount' => $amount             // Amount
    ];

    $result = $mpesa->B2CPayment($data);
```

- Transaction B2B Paymant (Business to Business):

```
    $data =[
        'to' => $to,                    // Receiver Party Code
        'reference' => $reference,      // Third Party Reference
        'transaction' => $transaction,  // Transaction Reference
        'amount' => $amount             // Amount
    ];

    $result = $mpesa->B2BPayment($data);
```

Require
-------

[](#require)

- [PHP ^7.3](https://www.php.net/ChangeLog-7.php#7.3.0)
- [PHP ^8.0](https://www.php.net/ChangeLog-8.php#8.0.0)

License
-------

[](#license)

This SDK is made available under the MIT License. Please see [License File](https://github.com/Klayton258/MpesaSdk/blob/main/LICENSE) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~100 days

Recently: every ~125 days

Total

6

Last Release

893d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e7aca22497fb25c40b829a868358c0fbf9f2c0f9ba59449a3db42e17acd03a4?d=identicon)[klayton](/maintainers/klayton)

---

Top Contributors

[![Klayton258](https://avatars.githubusercontent.com/u/68370709?v=4)](https://github.com/Klayton258 "Klayton258 (21 commits)")

### Embed Badge

![Health badge](/badges/say7ama-mpesa-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/say7ama-mpesa-sdk/health.svg)](https://phpackages.com/packages/say7ama-mpesa-sdk)
```

###  Alternatives

[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)

PHPackages © 2026

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