/
home
/
suroeste
/
public_html
/
payments.transportessuroeste.com
/
public
/
payment
/
/home/suroeste/public_html/payments.transportessuroeste.com/public/payment
mkdir
upload
Name
Size
Mode
Actions
checkout.php
7533
0644
edit
dl
rm
response.php
12701
0644
edit
dl
rm
retry.php
2911
0644
edit
dl
rm
Edit:
/home/suroeste/public_html/payments.transportessuroeste.com/public/payment/response.php
(12701B)
<?php /** * ============================================================================ * PÁGINA DE RESPUESTA DE PAGO * ============================================================================ */ require_once __DIR__ . '/../../config/config.php'; use TransportesSuroeste\Services\PaymentService; use TransportesSuroeste\Services\LogService; $refPayco = $_GET['ref_payco'] ?? $_GET['x_ref_payco'] ?? null; $transactionUuid = $_GET['x_extra2'] ?? $_GET['extra2'] ?? null ?? $_GET['tx']; $internalRef = $_GET['x_id_invoice'] ?? $_GET['x_extra3'] ?? null; $transaction = null; $status = 'unknown'; $redirectFinalUrl = null; $redirectUrl = defined('CLIENT_REDIRECT_URL') ? CLIENT_REDIRECT_URL : ''; try { $paymentService = new PaymentService(); if ($transactionUuid) { $transaction = $paymentService->getTransactionStatus($transactionUuid, 'uuid'); } elseif($refPayco){ $transaction = $paymentService->getTransactionStatus($refPayco, 'ref_payco'); } elseif ($internalRef) { $transaction = $paymentService->getTransactionStatus($internalRef, 'internal'); } if ($transaction) { $status = $transaction['status']; $separator = (strpos($redirectUrl, '?') !== false) ? '&' : '?'; $redirectFinalUrl2 = $redirectUrl . $separator . 'Ref_cobro=' . urlencode($transaction['ticket_reference']); // Redirigir al sistema del cliente solo si el pago fue aprobado if ($status === 'approved') { if (!empty($redirectUrl) && !empty($transaction['ticket_reference'])) { $redirectFinalUrl = $redirectUrl . $separator . 'Ref_cobro=' . urlencode($transaction['ticket_reference']); } } } } catch (Exception $e) {} $config = match($status) { 'approved' => [ 'class' => 'success', 'icon' => '✓', 'title' => '¡Pago Exitoso!', 'desc' => 'Tu transacción ha sido procesada correctamente.' ], 'pending' => [ 'class' => 'warning', 'icon' => '⏳', 'title' => 'Pago en Proceso', 'desc' => 'Tu pago está siendo verificado. Te notificaremos pronto.' ], 'rejected' => [ 'class' => 'danger', 'icon' => '✕', 'title' => 'Pago Rechazado', 'desc' => 'La transacción no pudo ser completada.' ], 'failed' => [ 'class' => 'danger', 'icon' => '!', 'title' => 'Error en el Pago', 'desc' => 'Ocurrió un problema al procesar tu pago.' ], default => [ 'class' => 'info', 'icon' => 'ℹ', 'title' => 'Estado del Pago', 'desc' => 'Verificando el estado de tu transacción.' ] }; ?> <!DOCTYPE html> <html lang="es"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?php echo htmlspecialchars($config['title']); ?> - Transportes Suroeste</title> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet"> <link rel="stylesheet" href="<?php echo htmlspecialchars(defined('BASE_PATH') ? BASE_PATH : ''); ?>/assets/css/payment-response.css?v=<?php echo time(); ?>"> <?php if ($redirectFinalUrl): ?> <meta http-equiv="refresh" content="8;url=<?php echo htmlspecialchars($redirectFinalUrl); ?>"> <?php endif; ?> </head> <body> <div class="container"> <div class="header <?php echo $config['class']; ?>"> <div class="status-icon"><?php echo $config['icon']; ?></div> <h1 class="status-title"><?php echo htmlspecialchars($config['title']); ?></h1> <p class="status-description"><?php echo htmlspecialchars($config['desc']); ?></p> </div> <div class="content"> <?php if ($transaction): ?> <div class="amount-display"> <div class="amount-label">Monto Total</div> <div class="amount-value"> $<?php echo number_format($transaction['amount'], 0, ',', '.'); ?> <span class="amount-currency"><?php echo $transaction['currency'] ?? 'COP'; ?></span> </div> </div> <div class="info-grid"> <div class="info-group"> <div class="info-label">Referencia</div> <div class="info-value ref-code"><?php echo htmlspecialchars($transaction['internal_reference']); ?></div> </div> <div class="info-group"> <div class="info-label">Ticket</div> <div class="info-value"><?php echo htmlspecialchars($transaction['ticket_reference']); ?></div> </div> </div> <?php if (!empty($transaction['payment_method']) || !empty($transaction['epayco_ref'])): ?> <div class="divider"></div> <div class="info-grid"> <?php if (!empty($transaction['payment_method'])): ?> <div class="info-group"> <div class="info-label">Método de Pago</div> <div class="info-value"><?php echo htmlspecialchars(ucfirst($transaction['payment_method'])); ?></div> </div> <?php endif; ?> <?php if (!empty($transaction['epayco_ref'])): ?> <div class="info-group"> <div class="info-label">Ref. ePayco</div> <div class="info-value ref-code"><?php echo htmlspecialchars($transaction['epayco_ref']); ?></div> </div> <?php endif; ?> </div> <?php endif; ?> <?php else: ?> <p class="no-info"> No se encontró información del pago.<br> Por favor, conserva tu comprobante. </p> <?php endif; ?> <?php if ($redirectFinalUrl): ?> <style> .rd-banner{text-align:center;padding:28px 20px;margin-top:24px;background:linear-gradient(135deg,#ecfdf5,#d1fae5,#a7f3d0);border-radius:16px;border:1px solid #6ee7b7} .rd-icon{width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,#059669,#10b981);display:flex;align-items:center;justify-content:center;margin:0 auto 16px;box-shadow:0 4px 14px rgba(5,150,105,0.35)} .rd-title{font-size:18px;font-weight:700;color:#065f46;margin:0 0 6px} .rd-desc{font-size:13px;color:#047857;margin:0 0 20px;line-height:1.4} .rd-nums{display:flex;align-items:baseline;justify-content:center;gap:6px;margin-bottom:16px;position:relative;height:56px} .rd-n{font-size:48px;font-weight:800;color:#065f46;line-height:1;position:absolute;left:50%;transform:translateX(calc(-50% - 40px));opacity:0} .rd-n:nth-child(1){animation:rdShow 1s 0s forwards} .rd-n:nth-child(2){animation:rdShow 1s 1s forwards} .rd-n:nth-child(3){animation:rdShow 1s 2s forwards} .rd-n:nth-child(4){animation:rdShow 1s 3s forwards} .rd-n:nth-child(5){animation:rdShow 1s 4s forwards} .rd-n:nth-child(6){animation:rdShow 1s 5s forwards} .rd-n:nth-child(7){animation:rdShow 1s 6s forwards} .rd-n:nth-child(8){animation:rdShow 1s 7s forwards} @keyframes rdShow{0%{opacity:1;transform:translateX(calc(-50% - 40px)) scale(1)}90%{opacity:1}100%{opacity:0;transform:translateX(calc(-50% - 40px)) scale(0.5)}} .rd-lbl{font-size:14px;font-weight:500;color:#047857;position:absolute;left:50%;transform:translateX(14px);top:38px} .rd-track{width:100%;height:6px;background:#d1fae5;border-radius:3px;overflow:hidden;margin-bottom:20px} .rd-bar{height:100%;width:100%;background:linear-gradient(90deg,#059669,#10b981);border-radius:3px;animation:rdShrink 8s linear forwards} @keyframes rdShrink{from{width:100%}to{width:0%}} .rd-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:14px 32px;background:linear-gradient(135deg,#059669,#10b981);color:#fff;border:none;border-radius:12px;font-size:15px;font-weight:600;text-decoration:none;cursor:pointer;box-shadow:0 4px 14px rgba(5,150,105,0.4)} .rd-btn:hover{transform:translateY(-2px);box-shadow:0 6px 20px rgba(5,150,105,0.5)} </style> <div class="rd-banner"> <div class="rd-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <rect x="2" y="6" width="20" height="12" rx="2"></rect> <path d="M12 12h.01"></path> <path d="M17 12h.01"></path> <path d="M7 12h.01"></path> </svg> </div> <p class="rd-title">Tu pago ha sido procesado</p> <p class="rd-desc">Seras redirigido a la pagina de generacion de tickets en</p> <div class="rd-nums"> <span class="rd-n">8</span> <span class="rd-n">7</span> <span class="rd-n">6</span> <span class="rd-n">5</span> <span class="rd-n">4</span> <span class="rd-n">3</span> <span class="rd-n">2</span> <span class="rd-n">1</span> <span class="rd-lbl">segundos</span> </div> <div class="rd-track"> <div class="rd-bar"></div> </div> <a href="<?php echo htmlspecialchars($redirectFinalUrl); ?>" class="rd-btn"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M18 8L22 12L18 16"></path> <path d="M2 12H22"></path> </svg> Ir ahora </a> </div> <?php else: ?> <div class="actions"> <a href="<?php echo htmlspecialchars($redirectFinalUrl2); ?>" class="btn btn-primary"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path> <polyline points="9 22 9 12 15 12 15 22"></polyline> </svg> Volver al Inicio </a> <?php if (($status === 'rejected' || $status === 'failed') && $transaction): ?> <a href="<?php echo htmlspecialchars(defined('BASE_PATH') ? BASE_PATH : ''); ?>/payment/retry?uuid=<?php echo urlencode($transaction['transaction_uuid']); ?>" class="btn btn-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <polyline points="23 4 23 10 17 10"></polyline> <path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path> </svg> Reintentar Pago </a> <?php endif; ?> </div> <?php endif; ?> </div> <div class="footer"> <p class="footer-logo">Pago procesado por <strong>Transportes Suroeste</strong></p> </div> </div> <?php if ($status === 'pending'): ?> <script> setTimeout(function() { location.reload(); }, 10000); </script> <?php endif; ?> </body> </html>
Save
cmd:
run