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

ActiveLibrary

molzieyy/omnipay-lnm-mpesa
==========================

Mpesa driver for the Omnipay payment processing library

v1.1(7y ago)010MITPHP

Since Apr 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/molzieyy/omnipay-mpesa)[ Packagist](https://packagist.org/packages/molzieyy/omnipay-lnm-mpesa)[ Docs](https://github.com/:vendor/omnipay-mpesa)[ RSS](/packages/molzieyy-omnipay-lnm-mpesa/feed)WikiDiscussions master Synced 2mo ago

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

omnipay-mpesa
=============

[](#omnipay-mpesa)

The Lipa na MPesa (LNM) API is an API designed to utilize the new feature introduced by Safaricom known as STK Push. This feature allows the transaction initiation to be moved from the paying customer's side to the payee Organization's side. This eliminates the challenge of having to remember business paybill numbers and account numbers and allows customers to simply confirm the transaction by entering their MPesa PIN on their mobile phone. This is done via the STK push/Pop-up which appears on a customer's phone that prompts them to enter their PIN. For the business, this API enables them to preset all the correct info in the payment request and reduce chances of wrong payments being performed to their systems. It is a C2B transaction, but with the initiator being the organization instead of the customer. Since the organization has the option of presetting all required variables in the request before sending the request, this API has no Validation-Confirmation process like the previous C2B API.

TL;DR
-----

[](#tldr)

Just want to see some code?

```
  use Omnipay\Omnipay;
  use Omnipay\Mpesa;

  $gateway = Omnipay::create('Mpesa');
  $gateway->setShortCode('174379');
  $gateway->setConsumerKey('');
  $gateway->setConsumerSecret('');
  $gateway->setPassKey('');
  $gateway->setTestMode('sandbox');

      $purchase = $gateway->purchase(array(
         'amount' => '100',
         'phone_number' => '254708374149',
         'account' => 'apitest',
         'description' => 'This is a purchase',
         'callbackUrl' => 'https://example.com/callback_url.php',
       ));

       if ($response->isSuccessful()) {
             echo "Input your pin to purchase!";

       }else{
           // Payment failed
           return $response->getMessage();
      }

      $data = $response->getData();
      echo '';print_r($data);echo '';

```

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

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Install
-------

[](#install)

Instal the gateway using require. Require the `league/omnipay` base package and this gateway.

```
$ composer require league/omnipay molzieyy/omnipay-lnm-mpesa
```

Usage
-----

[](#usage)

The following gateways are provided by this package:

- omnipay-mpesa

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

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 announcements, 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/:vendor/omnipay-mpesa/issues), or better yet, fork the library and submit a pull request.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [wasksofts](https://github.com/wasksofts)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Donate
------

[](#donate)

[![](https://camo.githubusercontent.com/e1ff554a09e8e92bef25abc553ff05b88f45afd695877cf12f3a46558ef65b2e/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BCPJC49Z4ZBLG)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 84.8% 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 ~3 days

Total

2

Last Release

2591d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96ae17d0f6cd7a585983f57a0a0dc7715f5197a7a7fb08dba57bdc0820c2b092?d=identicon)[molzieyy](/maintainers/molzieyy)

---

Top Contributors

[![stevenkamanu](https://avatars.githubusercontent.com/u/27777012?v=4)](https://github.com/stevenkamanu "stevenkamanu (39 commits)")[![molzieyy](https://avatars.githubusercontent.com/u/17297676?v=4)](https://github.com/molzieyy "molzieyy (7 commits)")

---

Tags

omnipaympesalipa-na-mpesa

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[silverstripe/silverstripe-omnipay

SilverStripe Omnipay Payment Module

38106.0k15](/packages/silverstripe-silverstripe-omnipay)

PHPackages © 2026

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