PHPackages                             ngodasamuel/mpesa - 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. ngodasamuel/mpesa

ActiveLibrary[Payment Processing](/categories/payments)

ngodasamuel/mpesa
=================

Package to integrate MPesa Services i.e. C2B, B2C, B2B and Online Checkout in your Laravel app. It allows you to receive and process soap sent by Safaricom. The package is still under heavy development and thus subject to bugs and changes.

v1.0.1-alpha(9y ago)08MITPHPPHP ^5.6 || ^7.0

Since Jan 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kchizi/mpesa)[ Packagist](https://packagist.org/packages/ngodasamuel/mpesa)[ RSS](/packages/ngodasamuel-mpesa/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Mpesa API Implementation
========================

[](#mpesa-api-implementation)

[![Latest Stable Version](https://camo.githubusercontent.com/654a26aa78abb59c9bb0f8f8a13b0e0c15f633a48fccf1c675f6cfa3336ce195/68747470733a2f2f706f7365722e707567782e6f72672f6c617772656e63653631352f6d706573612f762f737461626c65)](https://packagist.org/packages/lawrence615/mpesa)[![Total Downloads](https://camo.githubusercontent.com/588e0d0ced3454b4ac7e49be06b8f9b26041a5e9d4c77fc9fc92d99a8beef6bb/68747470733a2f2f706f7365722e707567782e6f72672f6c617772656e63653631352f6d706573612f646f776e6c6f616473)](https://packagist.org/packages/lawrence615/mpesa)[![Latest Unstable Version](https://camo.githubusercontent.com/0773db0e176261a5150970174b727f5d081b0424169e7bf5874f2b358b9d6908/68747470733a2f2f706f7365722e707567782e6f72672f6c617772656e63653631352f6d706573612f762f756e737461626c65)](https://packagist.org/packages/lawrence615/mpesa)[![License](https://camo.githubusercontent.com/f168e0a6358d3fbe8df69e3f375930692969dce00bfaa5c276e9ee006dce78f9/68747470733a2f2f706f7365722e707567782e6f72672f6c617772656e63653631352f6d706573612f6c6963656e7365)](https://packagist.org/packages/lawrence615/mpesa)

This package is created to integrate MPesa Services i.e. C2B, B2C, B2B and Online Checkout in your Laravel app. It allows you to receive and process soap sent by Safaricom. The package is still under heavy development and thus subject to bugs and changes.

Requirements
------------

[](#requirements)

- [PHP &gt;=5.6.0](http://php.net/)
- [Laravel 5.x](https://github.com/laravel/framework)

Quick Installation
------------------

[](#quick-installation)

```
composer require "lawrence615/mpesa:dev-master"
```

#### Service Provider

[](#service-provider)

```
Ngodasamuel\Mpesa\MpesaServiceProvider::class
```

#### Configuration and Assets

[](#configuration-and-assets)

```
php artisan vendor:publish --provider="Ngodasamuel\Mpesa\MpesaServiceProvider"
```

Then run php artisan migrate to create the tables in you database. This will create two tables;

1. mpesa\_payment\_logs table - logs everything received from Safaricom
2. payments table - breaks down what is received from Safaricom into a number of columns

Receiver Route
--------------

[](#receiver-route)

The route that receives the IPN is `c2b/payments/receiver` i.e. . This is the endpoint you give to Safaricom.

Events
------

[](#events)

There are events triggered when certain actions happen. You can extend the package's behaviour by setting up your own event listeners to provide custom functionality.

These are the events triggered by the package. The list will grow with time as more events come up;

EventAvailable datac2b.received.paymentFull C2B Payment Object**C2B Payment Event Listener**

Create a Controller i.e. PaymentsController then create a function c2bPayment

```
    //$payload will have the data from the event
    public function c2bPayment($payload){

    }
```

Register an event listener in the boot method of your EventServiceProvider:

```
Event::listen('c2b.received.payment', 'App\Http\Controllers\PaymentsController@c2bPayment');
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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 ~0 days

Total

2

Last Release

3456d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/669267?v=4)[Samuel Ngoda](/maintainers/kchizi)[@kchizi](https://github.com/kchizi)

---

Top Contributors

[![lawrence615](https://avatars.githubusercontent.com/u/3224157?v=4)](https://github.com/lawrence615 "lawrence615 (43 commits)")

### Embed Badge

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

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.5M923](/packages/statamic-cms)[srmklive/paypal

PayPal REST API client for Laravel and standalone PHP.

1.1k4.0M29](/packages/srmklive-paypal)[shetabit/multipay

PHP Payment Gateway Integration Package

293355.3k4](/packages/shetabit-multipay)[imdhemy/google-play-billing

Google Play Billing

491.4M5](/packages/imdhemy-google-play-billing)[lemonsqueezy/laravel

A package to easily integrate your Laravel application with Lemon Squeezy.

588114.4k](/packages/lemonsqueezy-laravel)[mollie/laravel-cashier-mollie

Laravel Cashier provides an expressive, fluent interface to Mollie's subscription billing services.

177185.5k1](/packages/mollie-laravel-cashier-mollie)

PHPackages © 2026

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