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

ActiveLibrary

iankumu/mpesa
=============

A package that helps integrate the Mpesa APIs to your Laravel Project

2.3.0(1mo ago)5014.7k↓44.3%34MITPHPPHP ^8.2 | ^8.3 | ^8.4

Since Dec 11Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Iankumu/mpesa)[ Packagist](https://packagist.org/packages/iankumu/mpesa)[ Docs](https://github.com/Iankumu/mpesa)[ RSS](/packages/iankumu-mpesa/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (28)Used By (0)

[![Laravel Mpesa Package](https://camo.githubusercontent.com/e3d16fe0367cf772f2a77a59d81fafa526add5dd908eb8bcb2afac326e2db7c2/68747470733a2f2f6173736574732e69616e6b756d752e636f6d2f323032332f30312f4c61726176656c2d4d706573612d42616e6e65722e706e67)](https://camo.githubusercontent.com/e3d16fe0367cf772f2a77a59d81fafa526add5dd908eb8bcb2afac326e2db7c2/68747470733a2f2f6173736574732e69616e6b756d752e636f6d2f323032332f30312f4c61726176656c2d4d706573612d42616e6e65722e706e67)

Mpesa Package for Laravel
=========================

[](#mpesa-package-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4d2286b8e7ba25cb1ea312ccc4a67f8172652184c199ca23f7c597da60c23c21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f49616e6b756d752f6d706573612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Iankumu/mpesa)[![GitHub Tests Action Status](https://camo.githubusercontent.com/0ce0d6b92710bcdafd53a0f6d474817b7fc2adf07192050acdc9742297733651/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f69616e6b756d752f6d706573612f63692e796d6c3f6c6f676f3d676974687562266c6162656c3d5465737473)](https://github.com/Iankumu/mpesa/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/0343591261bc3bd4436dc4ee65a20065377f758c2813a24e1aeaaf909a38d149/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f49616e6b756d752f6d706573612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Iankumu/mpesa)

A Laravel wrapper for the [Mpesa Daraja Apis](https://developer.safaricom.co.ke/APIs).This package allows you to integrate the Mpesa Daraja Apis into your Laravel Application with ease.

The package contains implementation of the following Daraja APIs

- Lipa na Mpesa Express Online(STKPUSH)
- Business to Customer(B2C)
- Business to Business(B2B)
- Customer to Business(C2B)
- Transaction status
- Account Balance
- Reversals

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

[](#installation)

You can install this package through composer

```
composer require iankumu/mpesa
```

Configuration
-------------

[](#configuration)

The next step is to publish the application configurations. Run the following command

```
php artisan mpesa:install
```

This will publish the `config/mpesa.php` file which contains the mpesa configurations for your applications. These credentials are provided on your [Safaricom Developer Portal](https://developer.safaricom.co.ke/).

You also need to specify the application's environment; either `sandbox` or `production` so that the relevant api url endpoints are called.

```
// config/mpesa.php
