Reserva de Estacionamento body{ margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,sans-serif; background:linear-gradient(135deg,#667eea,#764ba2); min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px } .card{ background:#fff; max-width:720px; width:100%; border-radius:24px; padding:40px; box-shadow:0 20px 60px rgba(0,0,0,.3); text-align:center } h1{margin-top:0;font-size:30px;color:#111} .status{font-size:18px;margin:20px 0} .ref{ font-family:monospace; font-size:22px; color:#667eea; letter-spacing:2px; margin:16px 0 } .details{ text-align:left; margin-top:30px; background:#f9fafb; padding:24px; border-radius:16px; display:none } .row{ display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid #e5e7eb } .row:last-child{border-bottom:none} .label{font-weight:600;color:#555} .value{color:#111} .ok{color:#0a7a2f} .err{color:#b00020} .warn{color:#c47f00} .actions{margin-top:30px} .btn{ padding:14px 26px; border-radius:14px; border:none; font-size:15px; cursor:pointer; text-decoration:none; display:inline-block } .print{background:#667eea;color:#fff} .home{background:#fff;border:2px solid #667eea;color:#667eea;margin-left:10px} .spinner{ display:inline-block; width:20px; height:20px; border:3px solid #667eea; border-top-color:transparent; border-radius:50%; animation:spin 1s linear infinite; margin-right:10px; vertical-align:middle } @keyframes spin{to{transform:rotate(360deg)}}

Verificar reserva

Verificação do pagamento em andamento…
Estado
Valor pago
Check-in
Check-out
Início
const params = new URLSearchParams(window.location.search); const ref = params.get('ref'); const checkoutId = params.get('checkout_id'); // Prioridade: ref > checkout_id if(ref){ loadByRef(ref); } else if(checkoutId){ resolveCheckout(checkoutId); } else { showError('Referência ausente'); } function resolveCheckout(checkoutId){ fetch('/wp-json/park-booking/v2/resolve-checkout?checkout_id=' + encodeURIComponent(checkoutId)) .then(r => r.json()) .then(d => { if(d.ok && d.ref){ loadByRef(d.ref); } else { // Fallback: mostra comunque successo generico // perché potrebbe essere un timing issue showGenericSuccess(checkoutId); } }) .catch(() => showGenericSuccess(checkoutId)); } function loadByRef(ref){ fetch('/wp-json/park-booking/v1/booking-status?ref=' + encodeURIComponent(ref)) .then(r => r.json()) .then(d => { if(d.ok){ render(d); } else { // Se non trova, potrebbe essere un timing issue // Mostra comunque successo con il ref showSuccessWithRef(ref); } }) .catch(() => showSuccessWithRef(ref)); } function showError(msg){ document.getElementById('title').textContent = 'Verificar reserva'; document.getElementById('status').innerHTML = '❌ ' + msg + ''; } function showGenericSuccess(checkoutId){ document.getElementById('title').textContent = '✅ Pagamento Concluído'; document.getElementById('status').innerHTML = 'Pagamento recebido com sucesso!
Receberá um e-mail de confirmação em breve.'; document.getElementById('ref').textContent = ''; } function showSuccessWithRef(ref){ document.getElementById('title').textContent = '✅ Reserva Confirmada'; document.getElementById('status').innerHTML = 'Pagamento concluído com sucesso'; document.getElementById('ref').textContent = ref; } function render(d){ document.getElementById('title').textContent = '✅ Reserva Confirmada'; document.getElementById('status').innerHTML = 'Pagamento concluído com sucesso'; document.getElementById('ref').textContent = d.ref; document.getElementById('details').style.display = 'block'; document.getElementById('d_status').innerHTML = '' + (d.status || 'PAID') + ''; document.getElementById('d_paid').textContent = (d.paid || 0) + ' €'; document.getElementById('d_arrival').textContent = d.arrival || '-'; document.getElementById('d_departure').textContent = d.departure || '-'; }
Close