Download the PHP package cimplival/pesapal without Composer
On this page you can find all versions of the php package cimplival/pesapal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cimplival/pesapal
More information about cimplival/pesapal
Files in cimplival/pesapal
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 6 API
Laravel 6 Package for the Pesapal API
Installation
Add this package using Composer
Add the following line to your composer.json
"nesbot/carbon": "2.24 as 2.25.1"
NB: version of nesbot/carbon might be different
Run the following line:
composer dump-autoload
Then lastly run the following line:
composer require cimplival/pesapal "dev-master"
Update your config
Add the service provider to the providers array in config/app.php:
Cimplival\Pesapal\PesapalServiceProvider::class,
Add the facade to the aliases array in config/app.php:
'Pesapal' => Cimplival\Pesapal\Facades\Pesapal::class,
Publish the package configuration
Publish the configuration file and migrations by running the provided console command:
php artisan vendor:publish --provider="Cimplival\Pesapal\PesapalServiceProvider"
Setup
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 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