From 6a8ad7b4be922dc3bf5f24b18d80503c0c47a2d5 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 25 May 2026 00:14:20 +0200 Subject: [PATCH] Phase4: Stripe --- src/components/billing/payment-status-banner.tsx | 11 ++++++----- src/messages/de.json | 4 ++-- src/messages/en.json | 4 ++-- src/messages/fr.json | 4 ++-- src/messages/it.json | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/components/billing/payment-status-banner.tsx b/src/components/billing/payment-status-banner.tsx index 9e034ff..faf7a41 100644 --- a/src/components/billing/payment-status-banner.tsx +++ b/src/components/billing/payment-status-banner.tsx @@ -30,13 +30,14 @@ export function PaymentStatusBanner() { const params = new URLSearchParams(window.location.search); if (params.has("paid")) { setState("paid"); - // Reload after 4s so the status badge picks up the webhook's - // effect on the invoice row. By then most webhook deliveries - // have landed; if not the user just sees "open" and can - // manually refresh. + // The webhook usually arrives before the browser redirect + // completes, so the page often renders with status='paid' + // on first load and this refresh is a no-op. In the rare + // case where it arrives slightly after, a short refresh + // picks up the status flip. 1.5s is comfortable for both. const timer = setTimeout(() => { router.refresh(); - }, 4000); + }, 1500); // Strip the query string out of the URL. const cleanUrl = window.location.pathname; window.history.replaceState({}, "", cleanUrl); diff --git a/src/messages/de.json b/src/messages/de.json index 2ee632a..b9260e9 100644 --- a/src/messages/de.json +++ b/src/messages/de.json @@ -740,7 +740,7 @@ }, "payWithCard": "Mit Karte bezahlen", "redirectingToStripe": "Weiterleitung…", - "paymentReceived": "Zahlung erhalten — vielen Dank. Der Status wird aktualisiert, sobald Stripe bestätigt (wenige Sekunden).", - "paymentCancelled": "Zahlung wurde abgebrochen. Die Rechnung ist weiterhin offen; Sie können es jederzeit erneut versuchen." + "paymentReceived": "Zahlung erhalten — vielen Dank!", + "paymentCancelled": "Zahlung abgebrochen." } } diff --git a/src/messages/en.json b/src/messages/en.json index 874c285..9e47d0e 100644 --- a/src/messages/en.json +++ b/src/messages/en.json @@ -740,7 +740,7 @@ }, "payWithCard": "Pay with card", "redirectingToStripe": "Redirecting…", - "paymentReceived": "Payment received — thank you. The status will update once Stripe confirms (a few seconds).", - "paymentCancelled": "Payment was cancelled. The invoice is still open; you can try again whenever." + "paymentReceived": "Payment received — thank you!", + "paymentCancelled": "Payment cancelled." } } diff --git a/src/messages/fr.json b/src/messages/fr.json index df74522..aea4167 100644 --- a/src/messages/fr.json +++ b/src/messages/fr.json @@ -740,7 +740,7 @@ }, "payWithCard": "Payer par carte", "redirectingToStripe": "Redirection…", - "paymentReceived": "Paiement reçu — merci. Le statut sera mis à jour dès la confirmation de Stripe (quelques secondes).", - "paymentCancelled": "Le paiement a été annulé. La facture reste ouverte ; vous pouvez réessayer à tout moment." + "paymentReceived": "Paiement reçu — merci !", + "paymentCancelled": "Paiement annulé." } } diff --git a/src/messages/it.json b/src/messages/it.json index 5169af2..49a2536 100644 --- a/src/messages/it.json +++ b/src/messages/it.json @@ -740,7 +740,7 @@ }, "payWithCard": "Paga con carta", "redirectingToStripe": "Reindirizzamento…", - "paymentReceived": "Pagamento ricevuto — grazie. Lo stato si aggiornerà alla conferma di Stripe (pochi secondi).", - "paymentCancelled": "Il pagamento è stato annullato. La fattura rimane aperta; puoi riprovare in qualsiasi momento." + "paymentReceived": "Pagamento ricevuto — grazie!", + "paymentCancelled": "Pagamento annullato." } }