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

ActiveLibrary[Payment Processing](/categories/payments)

weddingjuma/omnipay-mpesa
=========================

Mpesa driver for omnipay payment processing library

v1.0(7y ago)0101MITPHP

Since Nov 6Pushed 7y ago1 watchersCompare

[ Source](https://github.com/weddingjuma/omnipay-mpesa)[ Packagist](https://packagist.org/packages/weddingjuma/omnipay-mpesa)[ Docs](https://github.com/deadangroup/omnipay-mpesa)[ RSS](/packages/weddingjuma-omnipay-mpesa/feed)WikiDiscussions master Synced 3d ago

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

Omnipay: Mpesa
==============

[](#omnipay-mpesa)

**Mpesa driver for the Omnipay PHP payment processing library**

[![Build Status](https://camo.githubusercontent.com/f8c53fb0843434a629485d836c17bab4f2d6b89dcbca613de8eb069f34b24053/68747470733a2f2f7472617669732d63692e6f72672f7468657068706c65616775652f6f6d6e697061792d6d706573612e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/thephpleague/omnipay-mpesa)[![Latest Stable Version](https://camo.githubusercontent.com/e6be23903c7f7f71c8b0c902b4f90004a7c137dc22177d6b4cc73bfaab885e8c/68747470733a2f2f706f7365722e707567782e6f72672f6f6d6e697061792f6d706573612f76657273696f6e2e706e67)](https://packagist.org/packages/omnipay/mpesa)[![Total Downloads](https://camo.githubusercontent.com/1ec78805ad233795bad1fee8bdd22e1c1639b5a9b4849ea8bf3b048a5d7f0df3/68747470733a2f2f706f7365722e707567782e6f72672f6f6d6e697061792f6d706573612f642f746f74616c2e706e67)](https://packagist.org/packages/omnipay/mpesa)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP. This package implements Mpesa support for Omnipay.

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply require `league/omnipay` and `omnipay/mpesa` with Composer:

```
composer require league/omnipay omnipay/mpesa

```

Basic Usage
-----------

[](#basic-usage)

The following gateways are provided by this package:

- Mpesa

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)repository.

### Basic purchase example

[](#basic-purchase-example)

```
$gateway = \Omnipay\Omnipay::create('Mpesa');
$gateway->setApiKey('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM');

$response = $gateway->purchase(
    [
        "amount" => "10.00",
        "currency" => "EUR",
        "description" => "My first Payment",
        "returnUrl" => "https://webshop.example.org/mpesa-return.php"
    ]
)->send();

// Process response
if ($response->isSuccessful()) {

    // Payment was successful
    print_r($response);

} elseif ($response->isRedirect()) {

    // Redirect to offsite payment gateway
    $response->redirect();

} else {

    // Payment failed
    echo $response->getMessage();
}
```

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/thephpleague/omnipay-mpesa/issues), or better yet, fork the library and submit a pull request.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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

Unknown

Total

1

Last Release

2793d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1763f761332f863ace203999d9d2f46ecaafebf4f5b6c5ec7ab4efcac58c36a3?d=identicon)[weddingjuma](/maintainers/weddingjuma)

---

Top Contributors

[![ngugijames](https://avatars.githubusercontent.com/u/6430405?v=4)](https://github.com/ngugijames "ngugijames (4 commits)")[![weddingjuma](https://avatars.githubusercontent.com/u/10448809?v=4)](https://github.com/weddingjuma "weddingjuma (2 commits)")

---

Tags

paymentgatewaypaymerchantomnipaympesa

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

557422.2k11](/packages/lokielse-omnipay-alipay)[omnipay/mollie

Mollie driver for the Omnipay payment processing library

631.8M10](/packages/omnipay-mollie)[sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

1018.7k](/packages/sudiptpa-omnipay-nabtransact)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

155.1k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

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