Download the PHP package studio19/pesapal without Composer
On this page you can find all versions of the php package studio19/pesapal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download studio19/pesapal
More information about studio19/pesapal
Files in studio19/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 5 API
Laravel 5 Package for the Pesapal API based on the Studio19 package
Installation
Add this package using Composer
From the command line inside your project directory, simply type:
composer require Studio19/pesapal
Update your config
Add the service provider to the providers array in config/app.php:
Studio19\Pesapal\PesapalServiceProvider::class,
Add the facade to the aliases array in config/app.php:
'Pesapal' => Studio19\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="Studio19\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