home
/
u529748449
/
domains
/
borabilhete.com
/
public_html
/
public
➕ New
📤 Upload
✎ Editing:
aguardando.php
← Back
<?php // public/aguardando.php declare(strict_types=1); ini_set('display_errors','1'); error_reporting(E_ALL); require __DIR__ . '/../admin/conexao.php'; $token = $_GET['token'] ?? ''; if (!$token || strlen($token)<16) exit('Token inválido.'); $st=$conn->prepare("SELECT id, nome_cliente, forma_pagamento FROM pedidos WHERE token_seguro=? LIMIT 1"); $st->bind_param("s",$token); $st->execute(); $row=$st->get_result()->fetch_assoc(); $st->close(); if(!$row) exit('Pedido não encontrado.'); $nome = $row['nome_cliente']; $forma = $row['forma_pagamento'] ?: 'Pix'; // default visual $pid = $_GET['payment_id'] ?? ($_GET['collection_id'] ?? ''); ?> <!doctype html> <html lang="pt-br"> <head> <meta charset="utf-8"> <title>Aguardando confirmação do pagamento…</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:#f7f7f8;margin:0} .wrap{max-width:640px;margin:40px auto;background:#fff;border-radius:12px;box-shadow:0 6px 18px rgba(0,0,0,.06);padding:28px} h1{font-size:22px;margin:0 0 10px} p{color:#444;margin:6px 0 14px} .muted{color:#777;font-size:14px} .spinner{width:38px;height:38px;border:4px solid #eee;border-top-color:#555;border-radius:50%;animation:spin 1s linear infinite;margin:18px auto} @keyframes spin{to{transform:rotate(360deg)}} a.btn{display:inline-block;padding:10px 16px;border-radius:8px;background:#111;color:#fff;text-decoration:none} .actions{margin-top:16px;display:flex;gap:12px;flex-wrap:wrap} .badge{display:inline-block;background:#eee;border-radius:6px;padding:2px 8px;font-size:12px} </style> </head> <body> <div class="wrap"> <h1>⏳ Aguardando confirmação do pagamento…</h1> <p>Olá, <strong><?= htmlspecialchars($nome) ?></strong>.</p> <p>Método escolhido: <span class="badge"><?= htmlspecialchars($forma ?: 'Pix') ?></span></p> <div class="spinner"></div> <p class="muted">Geralmente confirma em poucos segundos após concluir no app/banco.</p> <div class="actions"> <a class="btn" href="../index.php" style="background:#444">← Voltar aos eventos</a> </div> </div> <script> const token = <?= json_encode($token) ?>; const pid = <?= json_encode($pid) ?>; async function tick(){ try{ const url = '/public/api/refresh_mp.php?token='+encodeURIComponent(token) + (pid ? '&payment_id='+encodeURIComponent(pid) : '') + '&t='+Date.now(); const r = await fetch(url,{cache:'no-store'}); if(r.ok){ const j = await r.json(); if (j.ok){ if (j.status === 'pago'){ location.href = '/public/sucesso.php?token='+encodeURIComponent(token); return; } if (j.status === 'cancelado'){ location.href = '/public/erro_pagamento.php?motivo=cancelado'; return; } } } }catch(e){} setTimeout(tick, 3000); } tick(); </script> </body> </html>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel