PHPackages                             ftg/mpesac2b - 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. ftg/mpesac2b

ActiveLibrary

ftg/mpesac2b
============

Package to integrate Mpesa C2B Service

012PHP

Since Apr 11Pushed 9y agoCompare

[ Source](https://github.com/fluidTechGlobal/c2bMpesa)[ Packagist](https://packagist.org/packages/ftg/mpesac2b)[ RSS](/packages/ftg-mpesac2b/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Mpesa c2b
=========

[](#mpesa-c2b)

[![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)

Build up upon from

This package is created to integrate c2b Mpesa. This package will only take payments payed by users in the system.

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

[](#requirements)

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

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

[](#quick-installation)

```
composer require "ftg/mpesac2b:dev-master"
```

#### Service Provider

[](#service-provider)

```
Ftg\Mpesa\MpesaServiceProvider::class,
```

#### Configuration and Assets

[](#configuration-and-assets)

```
php artisan vendor:publish --provider="Ftg\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**

Add the following to the .env

```
BusinessNumber=
MaxAmount=

```

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

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/69355cefeccab1b35da282335ce142b74f78a82f4ed112b9cb11292f0c23218f?d=identicon)[FluidTechGlobal](/maintainers/FluidTechGlobal)

---

Top Contributors

[![Situma](https://avatars.githubusercontent.com/u/12297360?v=4)](https://github.com/Situma "Situma (5 commits)")

### Embed Badge

![Health badge](/badges/ftg-mpesac2b/health.svg)

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

PHPackages © 2026

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