PHP code example of hos69shah / gateways
1. Go to this page and download the library: Download hos69shah/gateways 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/ */
hos69shah / gateways example snippets
try{
$mellat->start_payment();
}catch(HG\AllException $ae){
echo '<b>Result Code: </b>' . $mellat->result_code . '<br />';
echo HG\Language::get($ae->getMessage());
}
try {
$mellat->handle_payment();
echo '<h1 style="color:green">Payment Was Successful</h1>';
echo '<b>Sale Reference ID: </b>' . $mellat->sale_reference_id . '<br />';
echo '<b>Sale Order ID: </b>' . $mellat->sale_order_id . '<br />';
echo '<b>Card Holder Info: </b>' . $mellat->card_holder_info . '<br />';
echo '<b>Card Holder Pan: </b>' . $mellat->card_holder_pan . '<br />';
} catch (HG\AllException $ae) {
echo '<h1 style="color:red">Payment Was Unsuccessful</h1>';
$mellat->refund_payment();
echo '<b>Result Code: </b>' . $mellat->result_code . '<br />';
echo HG\Language::get($ae->getMessage());
}