PHP code example of hpez / gateway

1. Go to this page and download the library: Download hpez/gateway 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/ */

    

hpez / gateway example snippets


$gateway = \Gateway::make(new \Hpez\Gateway\Mellat\Mellat());
$gateway->setCallback("your callback route");
$gateway->setCellNumber("09xxxxxxxxx"); // Optional
$gateway->price($invoiceTotal)->ready();
$refId = $gateway->refId(); // شماره ارجاع بانک
$transactionId = $gateway->transactionId(); // شماره تراکنش
return $gateway->redirect();

$gateway = \Gateway::verify();
$trackingCode = $gateway->trackingCode();
$refId = $gateway->refId();
$cardNumber = $gateway->cardNumber();
bash
php artisan vendor:publish --provider="Hpez\Gateway\GatewayServiceProvider"