Download the PHP package knox/pesapal without Composer
On this page you can find all versions of the php package knox/pesapal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package pesapal
Short Description A laravel package that integrates into the pesapal api
License MIT
Homepage https://github.com/knox2/pesapal
Informations about the package pesapal
Pesapal Laravel 5,6,7,8,9,10 API
Laravel 5,6,7,8,9,10 Package for the Pesapal API
Installation
Add this package using Composer
From the command line inside your project directory, simply type:
composer require knox/pesapal
Update your config (for Laravel 5.4 and below)
Add the service provider to the providers array in config/app.php:
Knox\Pesapal\PesapalServiceProvider::class,
Add the facade to the aliases array in config/app.php:
'Pesapal' => Knox\Pesapal\Facades\Pesapal::class,
Publish the package configuration (for Laravel 5.4 and below)
Publish the configuration file and migrations by running the provided console command:
php artisan vendor:publish --provider="Knox\Pesapal\PesapalServiceProvider"
Setup
Pesapal IPN
For the url of the route use /pesapal-ipn eg mysite.com/pesapal-ipn as the IPN on the Pesapal Merchant settings dashboard
Environmental Variables
PESAPAL_CONSUMER_KEY pesapal consumer key
PESAPAL_CONSUMER_SECRET pesapal consumer secret
PESAPAL_CURRENCY ISO code for the currency
PESAPAL_IPN controller method to call for instant notifications IPN as relative path from App\Http\Controllers\ eg "TransactionController@confirmation"
PESAPAL_CALLBACK_ROUTE route name to handle the callback eg Route::get('donepayment', ['as' => 'paymentsuccess', 'uses'=>'PaymentsController@paymentsuccess']); The route name is "paymentsuccess"
NB: The controller method accepts 4 function parameters, Example:
Config
live - Live or Demo environment
The ENV Variables can also be set from here.
Usage
At the top of your controller include the facade
use Pesapal;
Example Code...Better Example..Haha
Assuming you have a Payment Model
Example ENV
Example View
Example Routes
Relevant routes example, to help exclude entire webhooks route group in Csrf check in VerifyCsrfToken Middleware
All Done
Feel free to report any issues