// Standard Receipt Data $amount = null2unknown($_GET["vpc_Amount"]); $locale = null2unknown($_GET["vpc_Locale"]); $batchNo = null2unknown($_GET["vpc_BatchNo"]); $command = null2unknown($_GET["vpc_Command"]); $message = null2unknown($_GET["vpc_Message"]); $version = null2unknown($_GET["vpc_Version"]); $cardType = null2unknown($_GET["vpc_Card"]); $orderInfo = null2unknown($_GET["vpc_OrderInfo"]); $receiptNo = null2unknown($_GET["vpc_ReceiptNo"]); $merchantID = null2unknown($_GET["vpc_Merchant"]); $authorizeID = null2unknown($_GET["vpc_AuthorizeId"]); $merchTxnRef = null2unknown($_GET["vpc_MerchTxnRef"]); $transactionNo = null2unknown($_GET["vpc_TransactionNo"]); $acqResponseCode = null2unknown($_GET["vpc_AcqResponseCode"]); $txnResponseCode = null2unknown($_GET["vpc_TxnResponseCode"]); // 3-D Secure Data $verType = array_key_exists("vpc_VerType", $_GET) ? $_GET["vpc_VerType"] : "No Value Returned"; $verStatus = array_key_exists("vpc_VerStatus", $_GET) ? $_GET["vpc_VerStatus"] : "No Value Returned"; $token = array_key_exists("vpc_VerToken", $_GET) ? $_GET["vpc_VerToken"] : "No Value Returned"; $verSecurLevel = array_key_exists("vpc_VerSecurityLevel", $_GET) ? $_GET["vpc_VerSecurityLevel"] : "No Value Returned"; $enrolled = array_key_exists("vpc_3DSenrolled", $_GET) ? $_GET["vpc_3DSenrolled"] : "No Value Returned"; $xid = array_key_exists("vpc_3DSXID", $_GET) ? $_GET["vpc_3DSXID"] : "No Value Returned"; $acqECI = array_key_exists("vpc_3DSECI", $_GET) ? $_GET["vpc_3DSECI"] : "No Value Returned"; $authStatus = array_key_exists("vpc_3DSstatus", $_GET) ? $_GET["vpc_3DSstatus"] : "No Value Returned"; // ******************* // END OF MAIN PROGRAM // ******************* // FINISH TRANSACTION - Process the VPC Response Data // ===================================================== // For the purposes of demonstration, we simply display the Result fields on a
$acqResponseCode = null2unknown($map, "vpc_AcqResponseCode"); $txnResponseCode = null2unknown($map, "vpc_TxnResponseCode"); // CSC Receipt Data $cscResultCode = null2unknown($map, "vpc_CSCResultCode"); $cscACQRespCode = null2unknown($map, "vpc_AcqCSCRespCode"); // AVS Receipt Data $avsResultCode = null2unknown($map, "vpc_AVSResultCode"); $vACQAVSRespCode = null2unknown($map, "vpc_AcqAVSRespCode"); $avs_City = null2unknown($map, "vpc_AVS_City"); $avs_Country = null2unknown($map, "vpc_AVS_Country"); $avs_Street01 = null2unknown($map, "vpc_AVS_Street01"); $avs_PostCode = null2unknown($map, "vpc_AVS_PostCode"); $avs_StateProv = null2unknown($map, "vpc_AVS_StateProv"); $avsRequestCode = null2unknown($map, "vpc_AVSRequestCode"); /********************* * END OF MAIN PROGRAM *********************/ // FINISH TRANSACTION - Process the VPC Response Data // ===================================================== // For the purposes of demonstration, we simply display the Result fields on a // web page. // Show 'Error' in title if an error condition $errorTxt = ""; // Show the display page as an error page if ($txnResponseCode == "7" || $txnResponseCode != "No Value Returned") { $errorTxt = "Error ";
$auth_time = null2unknown($_GET["auth_time"]); $message = null2unknown($_GET["message"]); $req_amount = null2unknown($_GET["req_amount"]); $auth_avs_code_raw = null2unknown($_GET["auth_avs_code_raw"]); $auth_cv_result = null2unknown($_GET["auth_cv_result"]); $req_reference_number = null2unknown($_GET["req_reference_number"]); $req_currency = null2unknown($_GET["req_currency"]); $signed_date_time = null2unknown($_GET["signed_date_time"]); $auth_cv_result_raw = null2unknown($_GET["auth_cv_result_raw"]); $auth_amount = null2unknown($_GET["auth_amount"]); $reason_code = null2unknown($_GET["reason_code"]); $req_locale = null2unknown($_GET["req_locale"]); $auth_code = null2unknown($_GET["auth_code"]); $vpc_Merchant = null2unknown($_GET["vpc_Merchant"]); $bill_trans_ref_no = null2unknown($_GET["bill_trans_ref_no"]); $auth_avs_code = null2unknown($_GET["auth_avs_code"]); // ******************* // END OF MAIN PROGRAM // ******************* // FINISH TRANSACTION - Process the VPC Response Data // ===================================================== // For the purposes of demonstration, we simply display the Result fields on a // web page. // Show 'Error' in title if an error condition // Show this page as an error page if vpc_TxnResponseCode equals '7' if ($txnResponseCode == "7" || $txnResponseCode == "No Value Returned" || $errorExists) { $errorTxt = "Error "; } // This is the display title for 'Receipt' page $title = $_GET["Title"]; // The URL link for the receipt to do another transaction.
$stringHashData = rtrim($stringHashData, "&"); if (strtoupper($vpc_Txn_Secure_Hash) == strtoupper(hash_hmac('SHA256', $stringHashData, pack('H*', $SECURE_SECRET)))) { $hashValidated = "CORRECT"; } else { $hashValidated = "INVALID HASH"; } } else { $hashValidated = "INVALID HASH"; } $amount = null2unknown($_GET["vpc_Amount"]); // So tien thanh toan $orderInfo = null2unknown($_GET["vpc_OrderInfo"]); // Ma hoa don (ID dat hang) $txnResponseCode = null2unknown($_GET["vpc_TxnResponseCode"]); // Ma tra ve $vpc_MerchTxnRef = null2unknown($_GET["vpc_MerchTxnRef"]); // Ma giao dich do OnePage Sinh ra dung de QueryDR sau nay $payment_id = (int) $_GET['vpc_TransactionNo']; if ($hashValidated == "CORRECT" and $txnResponseCode == "0") { // Giao dich thanh cong $nv_transaction_status = 4; } elseif ($hashValidated == "INVALID HASH" and $txnResponseCode == "0") { // Tam giu $nv_transaction_status = 2; } else { // Giao dich that bai $nv_transaction_status = 3; } $error_text = ""; // Chi tiet $transaction_i = array();
function parseDigitalReceipt() { $dReceipt = array("amount" => null2unknown($_REQUEST['vpc_Amount']), "locale" => null2unknown($_REQUEST['vpc_Locale']), "batchNo" => null2unknown($_REQUEST['vpc_BatchNo']), "command" => null2unknown($_REQUEST['vpc_Command']), "message" => null2unknown($_REQUEST['vpc_Message']), "version" => null2unknown($_REQUEST['vpc_Version']), "cardType" => null2unknown($_REQUEST['vpc_Card']), "orderInfo" => null2unknown($_REQUEST['vpc_OrderInfo']), "receiptNo" => null2unknown($_REQUEST['vpc_ReceiptNo']), "merchantID" => null2unknown($_REQUEST['vpc_Merchant']), "authorizeID" => null2unknown($_REQUEST['vpc_AuthorizeId']), "merchTxnRef" => null2unknown($_REQUEST['vpc_MerchTxnRef']), "transactionNo" => null2unknown($_REQUEST['vpc_TransactionNo']), "acqResponseCode" => null2unknown($_REQUEST['vpc_AcqResponseCode']), "txnResponseCode" => null2unknown($_REQUEST['vpc_TxnResponseCode'])); return $dReceipt; }