2017 © Pedro Peláez
 

library mpesa

Package 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.

image

ngodasamuel/mpesa

Package 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.

  • Monday, August 7, 2017
  • by kchizi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Mpesa API Implementation

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

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., (*2)

Requirements

Quick Installation

composer require "lawrence615/mpesa:dev-master"

Service Provider

Ngodasamuel\Mpesa\MpesaServiceProvider::class

Configuration and Assets

php artisan vendor:publish --provider="Ngodasamuel\Mpesa\MpesaServiceProvider"

Then run php artisan migrate to create the tables in you database. This will create two tables;, (*3)

  1. mpesa_payment_logs table - logs everything received from Safaricom, (*4)

  2. payments table - breaks down what is received from Safaricom into a number of columns, (*5)

Receiver Route

The route that receives the IPN is c2b/payments/receiver i.e. http://example.com/c2b/payments/receiver. This is the endpoint you give to Safaricom., (*6)

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., (*7)

These are the events triggered by the package. The list will grow with time as more events come up;, (*8)

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

C2B Payment Event Listener, (*9)

Create a Controller i.e. PaymentsController then create a function c2bPayment, (*10)

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

    }

Register an event listener in the boot method of your EventServiceProvider:, (*11)

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

The Versions

07/08 2017

dev-master

9999999-dev

Package 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.

  Sources   Download

MIT

The Requires

 

by Samuel Ngoda

12/01 2017

v1.0.1-alpha

1.0.1.0-alpha

Package 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.

  Sources   Download

MIT

The Requires

 

by Lawrence Macharia

12/01 2017

v1.0.0-alpha

1.0.0.0-alpha

Package 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.

  Sources   Download

MIT

The Requires

 

by Lawrence Macharia