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

ActiveLibrary[API Development](/categories/api)

safcom/mpesa
============

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

v3.0.0(1y ago)04MITPHPPHP ^8.0 | ^8.1 | ^8.2 | ^8.3

Since Sep 22Pushed 1y ago1 watchersCompare

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

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

safcom-mpesa
============

[](#safcom-mpesa)

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

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

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

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 safcom/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
