patricmutwiri / pesapal
Pesapal Laravel Package; Payments via pesapal in laravel made easy.
v1.1.0
2024-08-09 18:08 UTC
Requires
- php: ^7.4|^8.0
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- orchestra/testbench: ^6.0.0
- phpunit/phpunit: ^9.0
README
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.
Installation
You can install the package via composer:
composer require patricmutwiri/pesapal
Usage
// 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);
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 dev@patric.xyz 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.
Credits
License
The MIT License (MIT). Please see License File for more information.