Current File : /home/inlingua/public_html/sensoriumpsychologists.com/backup/include/pg/protx/fail.php
<?
$strCrypt=$_REQUEST["crypt"];
if (strlen($strCrypt)==0) {
	ob_end_flush();
	Redirect(make_url('home'));
}

// Now decode the Crypt field and extract the results
$strDecoded=simpleXor(Base64Decode($strCrypt),PROTX_ENT_PASSWORD);
$values = getToken($strDecoded);
// Split out the useful information into variables we can use
$strStatus=$values['Status'];
$strStatusDetail=$values['StatusDetail'];
$strVendorTxCode=$values["VendorTxCode"];
//$strVPSTxId=$values["VPSTxId"];
//$strTxAuthNo=$values["TxAuthNo"];
$strAmount=$values["Amount"];
$strAVSCV2=$values["AVSCV2"];
$strAddressResult=$values["AddressResult"];
$strPostCodeResult=$values["PostCodeResult"];
$strCV2Result=$values["CV2Result"];
$strGiftAid=$values["GiftAid"];
$str3DSecureStatus=$values["3DSecureStatus"];
$strCAVV=$values["CAVV"];

// Determine the reason this transaction was unsuccessful
if ($strStatus=="NOTAUTHED")
	$strReason="You payment was declined by the bank.  This could be due to insufficient funds, or incorrect card details.";
else if ($strStatus=="ABORT")
	$strReason="You chose to Cancel your order on the payment pages.  If you wish to change your order and resubmit it you can do so here. If you have questions or concerns about ordering online, please contact us at [your number].";
else if ($strStatus=="REJECTED") 
	$strReason="Your order did not meet our minimum fraud screening requirements. If you have questions about our fraud screening rules, or wish to contact us to discuss this, please call [your number].";
else if ($strStatus=="INVALID" or $strStatus=="MALFORMED")
	$strReason="We could not process your order because we have been unable to register your transaction with our Payment Gateway. You can place the order over the telephone instead by calling [your number].";
else if ($strStatus=="ERROR")
	$strReason="We could not process your order because our Payment Gateway service was experiencing difficulties. You can place the order over the telephone instead by calling [your number].";
else
	$strReason="The transaction process failed. Please contact us with the date and time of your order and we will investigate.";

	Redirect(make_url('fail'), 'msg='.$strReason);
	
?>