-
Notifications
You must be signed in to change notification settings - Fork 0
/
TxnStatus.php
78 lines (69 loc) · 2.11 KB
/
TxnStatus.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
<?php
header("Pragma: no-cache");
header("Cache-Control: no-cache");
header("Expires: 0");
// following files need to be included
require_once("./lib/config_paytm.php");
require_once("./lib/encdec_paytm.php");
$ORDER_ID = "";
$requestParamList = array();
$responseParamList = array();
if (isset($_POST["ORDER_ID"]) && $_POST["ORDER_ID"] != "") {
// In Test Page, we are taking parameters from POST request. In actual implementation these can be collected from session or DB.
$ORDER_ID = $_POST["ORDER_ID"];
// Create an array having all required parameters for status query.
$requestParamList = array("MID" => PAYTM_MERCHANT_MID , "ORDERID" => $ORDER_ID);
$StatusCheckSum = getChecksumFromArray($requestParamList,PAYTM_MERCHANT_KEY);
$requestParamList['CHECKSUMHASH'] = $StatusCheckSum;
// Call the PG's getTxnStatusNew() function for verifying the transaction status.
$responseParamList = getTxnStatusNew($requestParamList);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Transaction status query</title>
<meta name="GENERATOR" content="Evrsoft First Page">
</head>
<body>
<h2>Transaction status query</h2>
<form method="post" action="">
<table border="1">
<tbody>
<tr>
<td><label>ORDER_ID::*</label></td>
<td><input id="ORDER_ID" tabindex="1" maxlength="20" size="20" name="ORDER_ID" autocomplete="off" value="<?php echo $ORDER_ID ?>">
</td>
</tr>
<tr>
<td></td>
<td><input value="Status Query" type="submit" onclick=""></td>
</tr>
</tbody>
</table>
<br/></br/>
<?php
if (isset($responseParamList) && count($responseParamList)>0 )
{
?>
<h2>Response of status query:</h2>
<table style="border: 1px solid nopadding" border="0">
<tbody>
<?php
foreach($responseParamList as $paramName => $paramValue) {
?>
<tr >
<td style="border: 1px solid"><label><?php echo $paramName?></label></td>
<td style="border: 1px solid"><?php echo $paramValue?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
</form>
</body>
</html>