PHPackages                             ssiva/yii2-mpesa-sdk - 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. ssiva/yii2-mpesa-sdk

ActiveLibrary[API Development](/categories/api)

ssiva/yii2-mpesa-sdk
====================

This package provides a seamless integration of M-PESA Daraja APIs in Yii2 applications

v1.1.2(3y ago)021MITPHP

Since Apr 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ssiva13/yii2-mpesa-sdk)[ Packagist](https://packagist.org/packages/ssiva/yii2-mpesa-sdk)[ RSS](/packages/ssiva-yii2-mpesa-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

YII2 MPESA DARAJA SDK
---------------------

[](#yii2-mpesa-daraja-sdk)

This package provides a seamless integration of M-PESA Daraja APIs in Yii2 applications

- B2C (Business to Customer)
- C2B (Customer to Business)
- B2B (Business to Business)
- Account Balance inquiries
- Transaction reversals queries
- Transaction status queries.

### Installation

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist ssiva/yii2-mpesa-sdk

```

or

```
composer require --prefer-dist ssiva/yii2-mpesa-sdk

```

or add

```
"ssiva/yii2-mpesa-sdk": "*"

```

to the require section of your `composer.json` file.

### Configuration

[](#configuration)

Set up the config values as required

- Copy the file [mpesa.php](src/config/mpesa.php) to `@app/config/mpesa.php` and set you config values.
- Add the component configuration to `config/web.php` as below
    - Require the copied config file ```
        $mpesa = require __DIR__.'/mmpesa.php';
        ```
    - Add the required value to the components array ```
        'mpesaDaraja' => $mpesa,
        ```

The library is now ready for use.

### Usage Examples

[](#usage-examples)

```
