This package is meant to help you integrate painlessly with Pesapal. In the end, you can receive payments through Pesapal API v3.0 in your application.
You can install the package via composer:
composer require patricmutwiri/pesapal
// Load your invoice from DB, like
$invoice = Invoice::find(1);
// Then use it below
$paymentReq = new Request([
'amount' => $invoice->balance,
'email' => $invoice->user->email,
'phone' => $invoice->user->phone,
'first_name' => explode(' ', $invoice->user->name)[0],
'last_name' => explode(' ', $invoice->user->name)[1],
'id' => sprintf("%s-%s", $invoice->invoice_number, date('YmdHis')),
]);
// you can pass ipn_id above from your DB, or let the service add the latest one for you.
return Pesapal::payNow($paymentReq);
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead and log it under the issue tracker. All security vulnerabilities will be promptly addressed. Please do not disclose serious security-related issues publicly until a fix has been announced.
The MIT License (MIT). Please see License File for more information.