Easy intergation Mpesa OpenAPI in your Laravel applications.
Begin by adding in the package through Composer.
composer require openpesa/laravel-pesa
If you need to modify the configuations, you can run:
php artisan vendor:publish --provider="Openpesa\PesaServiceProvider"
Within your controllers, before you perform a redirect, make a call to the pesa()
function.
public function store()
{
$data = [
'input_Amount'=>5000,
// ...
];
try {
pesa()->c2b($data);
} catch(\Throwable $th) {
}
return back();
}
Full laravel example : laravel-pesa-demo
If you discover any security related issues, please email alphaolomi@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.