-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrespuesta.html
101 lines (94 loc) · 2.05 KB
/
respuesta.html
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
<?php
$ApiKey = "4Vj8eK4rloUd272L48hsrarnUA";
$merchant_id = $_REQUEST['merchantId'];
$referenceCode = $_REQUEST['referenceCode'];
$TX_VALUE = $_REQUEST['TX_VALUE'];
$New_value = number_format($TX_VALUE, 1, '.', '');
$currency = $_REQUEST['currency'];
$transactionState = $_REQUEST['transactionState'];
$firma_cadena = "$ApiKey~$merchant_id~$referenceCode~$New_value~$currency~$transactionState";
$firmacreada = md5($firma_cadena);
$firma = $_REQUEST['signature'];
$reference_pol = $_REQUEST['reference_pol'];
$cus = $_REQUEST['cus'];
$extra1 = $_REQUEST['description'];
$pseBank = $_REQUEST['pseBank'];
$lapPaymentMethod = $_REQUEST['lapPaymentMethod'];
$transactionId = $_REQUEST['transactionId'];
if ($_REQUEST['transactionState'] == 4 ) {
$estadoTx = "Transacción aprobada";
}
else if ($_REQUEST['transactionState'] == 6 ) {
$estadoTx = "Transacción rechazada";
}
else if ($_REQUEST['transactionState'] == 104 ) {
$estadoTx = "Error";
}
else if ($_REQUEST['transactionState'] == 7 ) {
$estadoTx = "Transacción pendiente";
}
else {
$estadoTx=$_REQUEST['mensaje'];
}
if (strtoupper($firma) == strtoupper($firmacreada)) {
?>
<h2>Resumen Transacción</h2>
<table>
<tr>
<td>Estado de la transaccion</td>
<td><?php echo $estadoTx; ?></td>
</tr>
<tr>
<tr>
<td>ID de la transaccion</td>
<td><?php echo $transactionId; ?></td>
</tr>
<tr>
<td>Referencia de la venta</td>
<td><?php echo $reference_pol; ?></td>
</tr>
<tr>
<td>Referencia de la transaccion</td>
<td><?php echo $referenceCode; ?></td>
</tr>
<tr>
<?php
if($pseBank != null) {
?>
<tr>
<td>cus </td>
<td><?php echo $cus; ?> </td>
</tr>
<tr>
<td>Banco </td>
<td><?php echo $pseBank; ?> </td>
</tr>
<?php
}
?>
<tr>
<td>Valor total</td>
<td>$<?php echo number_format($TX_VALUE); ?></td>
</tr>
<tr>
<td>Moneda</td>
<td><?php echo $currency; ?></td>
</tr>
<tr>
<td>Descripción</td>
<td><?php echo ($extra1); ?></td>
</tr>
<tr>
<td>Entidad:</td>
<td><?php echo ($lapPaymentMethod); ?></td>
</tr>
</table>
<?php
}
else
{
?>
<h1>Error validando firma digital.</h1>
<?php
}
?>