1. Go to this page and download the library: Download azreqat/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/ */
azreqat / laravel-payfort example snippets
return [
/**
* Defines wether to activate the Payfort sandbox enviroment or not.
*/
'sandbox' => env('PAYFORT_USE_SANDBOX', false),
/**
* The Payfort merchant account identifier.
*/
'merchant_identifier' => env('PAYFORT_MERCHANT_IDENTIFIER'),
/**
* The Payfort account access code.
*/
'access_code' => env('PAYFORT_ACCESS_CODE'),
/**
* The Payfort account sha type (sha256/sha512).
*/
'sha_type' => env('PAYFORT_SHA_TYPE', 'sha256'),
/**
* The Payfort account sha request phrase.
*/
'sha_request_phrase' => env('PAYFORT_SHA_REQUEST_PHRASE'),
/**
* The Payfort account sha response phrase.
*/
'sha_response_phrase' => env('PAYFORT_SHA_RESPONSE_PHRASE'),
/**
* The default currency for you app. Currency ISO code 3.
*/
'currency' => env('PAYFORT_CURRENCY', 'USD'),
/**
* The URL to return after submitting Payfort forms.
*/
'return_url' => env('PAYFORT_RETURN_URL', '/')
];
return Payfort::redirection()->displayRedirectionPage([
'command' => 'AUTHORIZATION', # AUTHORIZATION/PURCHASE according to your operation.
'merchant_reference' => 'ORDR.34562134', # You reference id for this operation (Order id for example).
'amount' => 100, # The operation amount.
'currency' => 'QAR', # Optional if you need to use another currenct than set in config.
'customer_email' => '[email protected]' # Customer email.
]);
return Payfort::redirection()->displayTokenizationPage([
'merchant_reference' => 'ORDR.34562134', # You reference id for this operation (Order id for example).
]);
use LaravelPayfort\Traits\PayfortResponse as PayfortResponse;
class PayfortOrdersController extends Controller{
use PayfortResponse;
public function processReturn(Request $request){
$payfort_return = $this->handlePayfortCallback($request);
# Here you can process the response and make your decision.
# The response structure is as described in payfort documentation
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.