Download the PHP package gituyu/jenga without Composer
On this page you can find all versions of the php package gituyu/jenga. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package jenga
Installtion
composer require gituyu/jenga
On Laravel, do publish package files.
php artsan vendor:publish
Select Provider: Finserve\Jenga\JengaServiceProvider
or Tag: jenga-config
Usage
In laravel controller use helper jengaCheckout($amount, $orderReference, $callbackurl, $custName = 'Client', $title = 'Pay Via EazzyPay',$is_sandbox = true, $website = 'NA', $extraData = 'NA', $currency = "KES", $outletCode = "0000000000")*
As used in example below,the output is a HTML string which should be injected on the checkout page. The visible part is a Payment Button that redirect to EazzyPayment Checkout Portal.After the client completes payment they are redirected back and a callback is triggered on payment update.
$payment_button= \App\Helpers\jengaCheckout(22,'dff','https://webhook.site/0a75a3f0-b545-4ce3-8c1f-926e7bded3df','John Doe','Pay now',true);
Configuration
Once you publish package files, a configuration in config/jenga.php is created.
Alternatively:
At your project root, create a .env file set these configs:
JENGA_USERNAME=[username]
JENGA_PASSWORD=[password]
JENGA_API_KEY=[api_key]
JENGA_PRIVATE_KEY=[/relative/path/to/private.pem]
JENGA_BASE_ENDPOINT=https://uat.jengahq.io
NB: The package is autodiscovered by laravel: For Laravel older version (less than 5.5) users.
open the Config/App.php file and add \Finserve\Jenga\JengaServiceProvider::class
under providers
and 'Jenga'=> \Finserve\Jenga\JengaServiceProvider::class
under aliases.
Forex
It supports optional paramenters. Supported service are:
currencyconverterapi.com .
API (https://free.currconv.com/api/) Limits to 100Req/min updates are quotes upto 45min.
getForex($baseCurrency = 'KES', $foreignCurrency = 'USD', $exchangeService = '1', $apiKey = '')
Example:
$forex=(new \Finserve\Jenga\Forex())->getForex('USD','KES');
Callback
Usage:
Route::get('/callback/route/here', function () { $data=\Finserve\Jenga\Callback(); //Do something });
Formated to as below: