ÿØÿà JFIF H H ÿÛ C ÿÛ Cÿ " ÿÄ ÿÄ ÿÚ ±5¬€ ÿÄ àÿÚ ÿÄ ÀÿÚ ? ÿÄ ÀÿÚ ? ÿÄ àÿÚ ? ÿÄ àÿÚ ?! ÿÚ ÿÄ ÀÿÚ ? ÿÄ ÀÿÚ ? ÿÄ àÿÚ ? ÿÙ
| Server IP : 160.25.81.117 / Your IP : 216.73.216.137 Web Server : Apache/2 System : Linux sv05.hilab.cloud 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : bellizen ( 1045) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/bellizen/domains/bellizeno.com/private_html/quocte_php/ |
Upload File : |
<?php
session_start();
$_SESSION['nhan_email'] = $_POST['vpc_Customer_Email'];
$_SESSION['nhan_name'] = $_POST['vpc_Customer_Id'];
$_SESSION['nhan_phone'] = $_POST['vpc_Customer_Phone'];
$_SESSION['nhan_district'] = $_POST['vpc_SHIP_Provice'];
$_SESSION['nhan_city'] = $_POST['vpc_SHIP_City'];
$_SESSION['nhan_country'] = $_POST['vpc_SHIP_Country'];
$_SESSION['nhan_street'] = $_POST['vpc_SHIP_Street01'];
$_SESSION['code'] = $_POST['vpc_OrderInfo'];
//Version 2.0
// *********************
// START OF MAIN PROGRAM
// *********************
// Define Constants
// ----------------
// This is secret for encoding the MD5 hash
// This secret will vary from merchant to merchant
// To not create a secure hash, let SECURE_SECRET be an empty string - ""
// $SECURE_SECRET = "secure-hash-secret";
$SECURE_SECRET = "6D0870CDE5F24F34F3915FB0045120DB";
// add the start of the vpcURL querystring parameters
$vpcURL = $_POST["virtualPaymentClientURL"] . "?";
// Remove the Virtual Payment Client URL from the parameter hash as we
// do not want to send these fields to the Virtual Payment Client.
unset($_POST["virtualPaymentClientURL"]);
// The URL link for the receipt to do another transaction.
// Note: This is ONLY used for this example and is not required for
// production code. You would hard code your own URL into your application.
// Get and URL Encode the AgainLink. Add the AgainLink to the array
// Shows how a user field (such as application SessionIDs) could be added
$_POST['AgainLink']=urlencode($_SERVER['HTTP_REFERER']);
//$_POST['AgainLink']=urlencode($_SERVER['HTTP_REFERER']);
// Create the request to the Virtual Payment Client which is a URL encoded GET
// request. Since we are looping through all the data we may as well sort it in
// case we want to create a secure hash and add it to the VPC data if the
// merchant secret has been provided.
//$md5HashData = $SECURE_SECRET; Khởi tạo chuỗi dữ liệu mã hóa trống
$md5HashData = "";
ksort ($_POST);
// set a parameter to show the first pair in the URL
$appendAmp = 0;
foreach($_POST as $key => $value) {
// create the md5 input and URL leaving out any fields that have no value
if (strlen($value) > 0) {
// this ensures the first paramter of the URL is preceded by the '?' char
if ($appendAmp == 0) {
$vpcURL .= urlencode($key) . '=' . urlencode($value);
$appendAmp = 1;
} else {
$vpcURL .= '&' . urlencode($key) . "=" . urlencode($value);
}
//$md5HashData .= $value; sỠdụng cả tên và giá trị tham số để mã hóa
if ((strlen($value) > 0) && ((substr($key, 0,4)=="vpc_") || (substr($key,0,5) =="user_"))) {
$md5HashData .= $key . "=" . $value . "&";
}
}
}
//xóa ký tự & ở thừa ở cuối chuỗi dữ liệu mã hóa
$md5HashData = rtrim($md5HashData, "&");
// Create the secure hash and append it to the Virtual Payment Client Data if
// the merchant secret has been provided.
if (strlen($SECURE_SECRET) > 0) {
//$vpcURL .= "&vpc_SecureHash=" . strtoupper(md5($md5HashData));
// Thay hà m mã hóa dữ liệu
$vpcURL .= "&vpc_SecureHash=" . strtoupper(hash_hmac('SHA256', $md5HashData, pack('H*',$SECURE_SECRET)));
}
// FINISH TRANSACTION - Redirect the customers using the Digital Order
// ===================================================================
header("Location: ".$vpcURL);
// *******************
// END OF MAIN PROGRAM
// *******************