PHPackages                             amoori/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. [API Development](/categories/api)
4. /
5. amoori/mpesa

ActiveLibrary[API Development](/categories/api)

amoori/mpesa
============

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

0130PHP

Since Sep 8Pushed 1y agoCompare

[ Source](https://github.com/AmirMehrabi/mpesa)[ Packagist](https://packagist.org/packages/amoori/mpesa)[ RSS](/packages/amoori-mpesa/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Laravel Mpesa Package](https://camo.githubusercontent.com/4d9bb3751ceb7eee25be91915d01a4a61a29323e538f084e3f08fb7c8a7d49c7/68747470733a2f2f7777772e69616e6b756d752e636f6d2f626c6f672f77702d636f6e74656e742f75706c6f6164732f323032332f30312f4c61726176656c2d4d706573612d42616e6e65722e706e67)](https://camo.githubusercontent.com/4d9bb3751ceb7eee25be91915d01a4a61a29323e538f084e3f08fb7c8a7d49c7/68747470733a2f2f7777772e69616e6b756d752e636f6d2f626c6f672f77702d636f6e74656e742f75706c6f6164732f323032332f30312f4c61726176656c2d4d706573612d42616e6e65722e706e67)

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/d76b41b9c6b291370792c15b97a517b7d8c98896ffcc3046fad8bc7720d77939/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f49616e6b756d752f6d706573612f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](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 package 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
