-
Notifications
You must be signed in to change notification settings - Fork 0
/
return.php
114 lines (109 loc) · 4.51 KB
/
return.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<title>VNPAY RESPONSE</title>
<!-- Bootstrap core CSS -->
<link href="/vnpay_php/assets/bootstrap.min.css" rel="stylesheet"/>
<!-- Custom styles for this template -->
<link href="/vnpay_php/assets/jumbotron-narrow.css" rel="stylesheet">
<link rel="stylesheet" href="./css/style.css">
<script src="/vnpay_php/assets/jquery-1.11.3.min.js"></script>
</head>
<body>
<?php
require_once("./config.php");
$vnp_SecureHash = $_GET['vnp_SecureHash'];
$inputData = array();
foreach ($_GET as $key => $value) {
if (substr($key, 0, 4) == "vnp_") {
$inputData[$key] = $value;
}
}
unset($inputData['vnp_SecureHash']);
ksort($inputData);
$i = 0;
$hashData = "";
foreach ($inputData as $key => $value) {
if ($i == 1) {
$hashData = $hashData . '&' . urlencode($key) . "=" . urlencode($value);
} else {
$hashData = $hashData . urlencode($key) . "=" . urlencode($value);
$i = 1;
}
}
$secureHash = hash_hmac('sha512', $hashData, $vnp_HashSecret);
?>
<!--Begin display -->
<div class="container">
<div class="header clearfix">
<h3 class="text-muted">VNPAY RESPONSE</h3>
</div>
<div class="table-responsive">
<div class="form-group">
<label >Mã đơn hàng:</label>
<label><?php echo $_GET['vnp_TxnRef'] ?></label>
</div>
<div class="form-group">
<label >Số tiền:</label>
<label><?php echo $_GET['vnp_Amount']/100 .' VND' ?></label>
</div>
<div class="form-group">
<label >Nội dung thanh toán:</label>
<label><?php echo $_GET['vnp_OrderInfo'] ?></label>
</div>
<div class="form-group">
<label >Mã phản hồi (vnp_ResponseCode):</label>
<label><?php echo $_GET['vnp_ResponseCode'] ?></label>
</div>
<div class="form-group">
<label >Mã GD Tại VNPAY:</label>
<label><?php echo $_GET['vnp_TransactionNo'] ?></label>
</div>
<div class="form-group">
<label >Mã Ngân hàng:</label>
<label><?php echo $_GET['vnp_BankCode'] ?></label>
</div>
<div class="form-group">
<label >Thời gian thanh toán:</label>
<label><?php echo $_GET['vnp_PayDate'] ?></label>
</div>
<div class="form-group">
<label >Kết quả:</label>
<label>
<?php
if ($secureHash == $vnp_SecureHash) {
if ($_GET['vnp_ResponseCode'] == '00') {
echo "<span style='color:blue'>GD Thanh cong</span>";
} else {
echo "<span style='color:red'>GD Khong thanh cong</span>";
}
} else {
echo "<span style='color:red'>Chu ky khong hop le</span>";
}
?>
</label>
</div>
<div class="form-group">
<?php
echo '<a style="padding: 5px;
border: 1px solid;
text-decoration: none;
margin-left: 400px;" href="index.php?page=1">Tiếp tục mua hàng </a>';
?>
</div>
</div>
<p>
</p>
<footer class="footer">
<p>© VNPAY <?php echo date('Y')?></p>
</footer>
</div>
</body>
</html>