2017 © Pedro Peláez
 

package mpesa

A PHP package for Mpesa API

image

mossey/mpesa

A PHP package for Mpesa API

  • Friday, November 3, 2017
  • by mossey
  • Repository
  • 5 Watchers
  • 6 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

This package has been abandoned please use https://github.com/safaricom/mpesa-php-sdk, (*1)

Introduction, (*2)

This package seeks to help php developers implement the various Mpesa APIs without much hustle. It is based on the REST API whose documentation is available on http://developer.safaricom.co.ke., (*3)

Installation using composer
composer require mossey/mpesa
, (*4)

Configuration
At your project root, create a .env file and in it set the consumer key and consumer secret as follows
consumer_key= [consumer key]
consumer_secret=[consumer secret]
For Laravel users, open the Config/App.php file and add \Mossey\Mpesa\MpesaServiceProvider::class under providers and 'Mpesa'=> \Mossey\Mpesa\MpesaServiceProvider::class under aliases., (*5)

Usage, (*6)

Confirmation and validation urls, (*7)

B2C Payment Request, (*8)

This creates transaction between an M-Pesa short code to a phone number registered on M-Pesa., (*9)

$mpesa= new \Mossey\Mpesa\Mpesa();, (*10)

$b2cTransaction=$mpesa->b2c( $ShortCode, $CommandID, $Amount, $Msisdn, $BillRefNumber );, (*11)

Account Balance Request, (*12)

This is used to enquire the balance on an M-Pesa BuyGoods (Till Number), (*13)

$mpesa= new \Mossey\Mpesa\Mpesa();, (*14)

$balanceInquiry=$mpesa->accountBalance($CommandID, $Initiator, $SecurityCredential, $PartyA, $IdentifierType, $Remarks, $QueueTimeOutURL, $ResultURL);, (*15)

Transaction Status Request This is used to check the status of transaction., (*16)

$mpesa= new \Mossey\Mpesa\Mpesa();, (*17)

$trasactionStatus=$mpesa->transactionStatus($Initiator, $SecurityCredential, $CommandID, $TransactionID, $PartyA, $IdentifierType, $ResultURL, $QueueTimeOutURL, $Remarks, $Occasion);, (*18)

B2B Payment Request, (*19)

This is used to transfer funds between two companies., (*20)

$mpesa= new \Mossey\Mpesa\Mpesa();, (*21)

$b2bTransaction=$mpesa->b2b($ShortCode, $CommandID, $Amount, $Msisdn, $BillRefNumber );, (*22)

STK Push Simulation, (*23)

This is used to initiate online payment on behalf of a customer., (*24)

$mpesa= new \Mossey\Mpesa\Mpesa();, (*25)

$stkPushSimulation=$mpesa->STKPushSimulation($BusinessShortCode, $LipaNaMpesaPasskey, $TransactionType, $Amount, $PartyA, $PartyB, $PhoneNumber, $CallBackURL, $AccountReference, $TransactionDesc, $Remarks);, (*26)

STK Push Status Query, (*27)

This is used to check the status of a Lipa Na M-Pesa Online Payment., (*28)

$mpesa= new \Mossey\Mpesa\Mpesa();, (*29)

$STKPushRequestStatus=$mpesa->STKPushQuery($checkoutRequestID,$businessShortCode,$password,$timestamp);, (*30)

Confirmation and Validation, (*31)

These are required in order to complete most of the transaction. Without these the transactions won't be complete. Therefore, register your URLS in the developer portal and soon as you're done be sure to ensure your validation URL and confirmation URL contain the following., (*32)

Validation, (*33)

$mpesa= new \Mossey\Mpesa\Mpesa();, (*34)

$b2bTransaction=$mpesa->validate();, (*35)

Confirmation, (*36)

$mpesa= new \Mossey\Mpesa\Mpesa();, (*37)

$b2bTransaction=$mpesa->confirm();, (*38)

The Versions

03/11 2017

dev-master

9999999-dev

A PHP package for Mpesa API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Moses Nandwa

03/11 2017

1.0.3

1.0.3.0

A PHP package for Mpesa API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Moses Nandwa

16/10 2017

1.0.2

1.0.2.0

A PHP package for Mpesa API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Moses Nandwa

16/10 2017

1.0.1

1.0.1.0

A PHP package for Mpesa API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Moses Nandwa

16/10 2017

1.0.0

1.0.0.0

A PHP package for Mpesa API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Moses Nandwa