/* Decoded by unphp.net */
if (stristr($_SERVER['SERVER_NAME'], 'hostixo.com') === false)
{
echo 'Ykd Script Sanal Pos Modülü Lisans Hatasi';
exit;
}
# Required File Includes
//include("../../../dbconnect.php");
include("../../../init.php");
include("../../../includes/functions.php");
include("../../../includes/gatewayfunctions.php");
include("../../../includes/invoicefunctions.php");
$gatewaymodule = "qnbfinans"; # Enter your gateway module name here replacing template
$GATEWAY = getGatewayVariables($gatewaymodule);
if (!$GATEWAY["type"]) die("Module Not Activated"); # Checks gateway module is active before accepting callback
//YKD
$UserCode = $GATEWAY["qnbfinans_usercode"];
$MerchantPass = $GATEWAY["qnbfinans_storekey"];
$status = '0';
if ($_GET['oid'] != '')
{
$ResponseMessage = $_POST['ErrorMessage'];
$response = $_POST["ProcReturnCode"];
if (($_POST['3DStatus'] == '1' || $_POST['3DStatus'] == '2' || $_POST['3DStatus'] == '3' || $_POST['3DStatus'] == '4') && ($response == "00")){
//hash kontrol
$hashstr = $_POST['MerchantID'] . $MerchantPass . $_POST['OrderId'] . $_POST['AuthCode'] . $_POST['ProcReturnCode'] . $_POST['3DStatus'] . $_POST['ResponseRnd'] . $UserCode;
$hash = base64_encode(pack('H*',sha1($hashstr)));
//
if($hash != $_POST['ResponseHash'])
{
$status = '0';
}else{
$status = '1';
}
}else{
$status = '0';
}
} else {
//$_SESSION['BilgiMesaji']['Mesaj'] = "Geçersiz Sayısal İmza !";
//$_SESSION['BilgiMesaji']['Tip'] = "hata";
$status = '0';
}
//YKD son
# Get Returned Variables - Adjust for Post Variable Names from your Gateway's Documentation
//$status = $_POST["x_response_code"];
$invoiceid = $_GET['oid'];
$transid = $_GET['oid'];
//$amount = $_POST["x_amount"];
$amount = '';
$fee = 0;
$invoiceid = checkCbInvoiceID($invoiceid,$GATEWAY["name"]); # Checks invoice ID is a valid invoice number or ends processing
checkCbTransID($transid); # Checks transaction number isn't already in the database and ends processing if it does
if ($status=="1") {
# Successful
addInvoicePayment($invoiceid,$transid,$amount,$fee,$gatewaymodule); # Apply Payment to Invoice: invoiceid, transactionid, amount paid, fees, modulename
logTransaction($GATEWAY["name"],$_POST,"Successful"); # Save to Gateway Log: name, data array, status
//echo '';
//echo '';
callback3DSecureRedirect($invoiceid, true);
exit;
} else {
# Unsuccessful
logTransaction($GATEWAY["name"],$_POST,"Unsuccessful"); # Save to Gateway Log: name, data array, status
//echo '';
}
//header("Location:".$GATEWAY['systemurl']."/viewinvoice.php?id=".$invoiceid);
//echo '';
callback3DSecureRedirect($invoiceid, false);