No description or website provided.
PHP HTML
Permalink
Failed to load latest commit information.
src Commenting sections of the code Jan 12, 2017
vendor initial commit Jan 11, 2017
README.md Updated README with more details Jan 12, 2017
composer.json Changed minimum-stability to alpha Jan 12, 2017

README.md

Mpesa API Implementation

This package is created to integrate MPesa Services i.e. C2B, B2C, B2B and Online Checkout in your Laravel app. It allows you to receive and process soap sent by Safaricom. The package is still under heavy development and thus subject to bugs and changes.

Requirements

Quick Installation

composer require "lawrence615/mpesa:dev-master"

Service Provider

Mobidev\Mpesa\MpesaServiceProvider::class

Configuration and Assets

$ php artisan vendor:publish

Then run php artisan:migrate to create the tables in you database

Events

There are events triggered when certain actions happen. You can extend the package's behaviour by setting up your own event listeners to provide custom functionality.

These are the events triggered by the package. The list will grow with time as more events come up;

Event Available data
c2b.received.payment Full C2B Payment Object

C2B Payment Event Listener

Create a Controller i.e. PaymentsController then create a function c2bPayment

    //$payload will have the data from the event
    public function c2bPayment($payload){

    }

Register an event listener in the boot method of your EventServiceProvider:

Event::listen('c2b.received.payment', 'App\Http\Controllers\PaymentsController@c2bPayment');