Skip to content

A PHP sdk for the new Vodacom Mpesa RESTful APIs 🇲🇿

License

Notifications You must be signed in to change notification settings

karthi4all/mpesa-php-sdk

 
 

Repository files navigation

Mpesa Mozambique PHP SDK

Latest Version on Packagist Build Status Quality Score Total Downloads

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 https://developer.mpesa.vm.co.mz/.

Installation

You can install the package via composer:

composer require karson/mpesa-php-sdk

Usage

// Set the consumer key and consumer secret as follows
$mpesa = new \Karson\MpesaPhpSdk\Mpesa();
$mpesa->setApiKey('your api key');
$mpesa->setPublicKey('your public key');
$mpesa->setEnv('test');// 'live' production environment 

//This creates transaction between an M-Pesa short code to a phone number registered on M-Pesa.

$result = $mpesa->c2b($invoice_id, $phone_number, $amount, $reference_id, $shortcode);

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email karson@turbohost.co instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate.

About

A PHP sdk for the new Vodacom Mpesa RESTful APIs 🇲🇿

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%