1. Go to this page and download the library: Download midoelhawy/laravel-payfort library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
midoelhawy / laravel-payfort example snippets
'providers' => [
// Other service providers...
LaravelPayfort\Providers\PayfortServiceProvider::class,
],
return Payfort::redirection()->displayRedirectionPage([
'command' => 'AUTHORIZATION', # AUTHORIZATION/PURCHASE according to your operation.
'merchant_reference' => 'ORDR.'.rand(10000,100000),
'amount' => 3501.35,
'currency' => 'SAR',
'customer_email' => '[email protected]',
'payment_option' => 'VISA', //Mada and others types
"language"=>'ar',
'return_url'=>"https://expm.com/response"
]);
return Payfort::redirection()->displayTokenizationPage([
'merchant_reference' => 'ORDR.34562134', # You reference id for this operation (Order id for example).
]);
$checkpayfort->captureOperationByFortId(
[
"fort_id"=>$payfort_return["fort_id"],
"merchant_reference"=>$payfort_return["merchant_reference"],
"amount"=>3501.35,//your amount to capture (max : the authraized amount)
"currency"=>"SAR",
]
);