-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathretorno.php
61 lines (59 loc) · 2.25 KB
/
retorno.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
<?php
if(isset($_GET['type']) && isset($_GET['doc_id'])) {
$fileName = implode("", [
'respuestas/',
$_GET['type'],
'_',
$_GET['doc_id'],
'.json'
]);
$respuesta = file_exists($fileName) ? json_decode(file_get_contents($fileName), true) : [];
} else {
die("Uso indebido de esta página");
}
?>
<html>
<head></head>
<body>
<?php if(count($respuesta) > 0) { ?>
<h1>Cobro exitoso!</h1>
<table border="1">
<tr>
<th>Código de sesión</th>
<td><?=$respuesta['debt']['docId']?></td>
</tr>
<tr>
<th>Descripción</th>
<td><?=$respuesta['debt']['label']?></td>
</tr>
<tr>
<th>Fecha de compra</th>
<td><?=$respuesta['debt']['created']?></td>
</tr>
<tr>
<th>Monto</th>
<td><?=$respuesta['debt']['amount']['currency']?> <?=(int) $respuesta['debt']['amount']['paid']?></td>
</tr>
<tr>
<th>Detalle</th>
<td><table border="1">
<tr>
<th>ID Transacción</th>
<th>Medio de pago</th>
<th>Monto cobrado</th>
</tr>
<?php foreach($respuesta['debt']['refs']['txList'] as $detalle) { ?>
<tr>
<td><?=$detalle['txId']?></td>
<td><?=$detalle['method']?></td>
<td><?=$detalle['realAmount']['currency']?> <?=(int) $detalle['realAmount']['value']?></td>
</tr>
<?php } ?>
</table></td>
</tr>
</table>
<?php } else { ?>
<p>No se pudo realizar el cobro. Puede reintentar el pago en esta dirección: <a href="https://staging.adamspay.com/pay/el-mercadi369/debt/<?=$_GET['doc_id']?>">https://staging.adamspay.com/pay/el-mercadi369/debt/<?=$_GET['doc_id']?></a></p>
<?php } ?>
</body>
</html>