include("sagepay/includes.php");
session_start();
/**************************************************************************************************
* Form PHP Kit Order Successful Page
***************************************************************************************************
***************************************************************************************************
* Change history
* ==============
* 27/05/2009 - Simon Wolfe - Updated for AES encryption and XSS fixes
* 10/02/2009 - Simon Wolfe - Updated for protocol 2.23
* 18/10/2007 - Nick Selby - New kit version
****************************************************************************************************
* Description
* ===========
* This is a placeholder for your Successful Order Completion Page. It retrieves the VendorTxCode
* from the crypt string and displays the transaction results on the screen. You wouldn't display
* all the information in a live application, but during development this page shows everything
* sent back in the confirmation screen.
****************************************************************************************************/
// Check for the proceed button click, and if so, go to the buildOrder page
/*if ($_REQUEST["navigate"]=="proceed") {
ob_end_flush();
// Redirect to next page
redirect("index.php");
}*/
$strCrypt=$_REQUEST["crypt"];
// Now check we have a Crypt field passed to this page
/*$strCrypt=$_REQUEST["crypt"];
if (strlen($strCrypt)==0) {
ob_end_flush();
redirect("index.php");
}*/
$strCrypt=$_SERVER['REQUEST_URI'];
// Now check we have a Crypt field passed to this page
$strcryPos = strpos($strCrypt,'?crypt=');
$strcryStr = substr($strCrypt,$strcryPos+7);
$strDecoded=decodeAndDecrypt($strcryStr);
$values = getToken($strDecoded);
// Split out the useful information into variables we can use
$strStatus=$values['Status'];
$strStatusDetail=$values['StatusDetail'];
$strBillingFirstnames= $_SESSION["strBillingFirstnames"];
$strBillingSurname = $_SESSION["strBillingSurname"];
$strCustomerEMail = $_SESSION["strCustomerEMail"];
$strVendorTxCode=$values["VendorTxCode"];
$strVPSTxId=$values["VPSTxId"];
$strTxAuthNo=$values["TxAuthNo"];
$strAmount=$values["Amount"];
$strAVSCV2=$values["AVSCV2"];
$strAddressResult=$_SESSION['strBillingAddress1'];
$strPostCodeResult=$_SESSION['strBillingPostCode'];
$strCV2Result=$values["CV2Result"];
$strGiftAid=$values["GiftAid"];
$str3DSecureStatus=$values["3DSecureStatus"];
$strCAVV=$values["CAVV"];
$strCardType=$values["CardType"];
$strLast4Digits=$values["Last4Digits"];
$strAddressStatus=$values["AddressStatus"]; // PayPal transactions only
$strPayerStatus=$values["PayerStatus"]; // PayPal transactions only
$book_id = $_SESSION['event_bookt'][0]['eventnid'];
$att = $_SESSION['event_bookt'];
$ticketsco =$_SESSION['ticket'];
// Empty the cart, we're done with it now because the order is successful
$mycart = '';
if(isset($_SESSION["nonm"])) {
$mycart = $_SESSION["nonm"];
}else{
$mycart = '';
}
?>