diff --git a/make_post_sell/templates/crypto_checkout.j2 b/make_post_sell/templates/crypto_checkout.j2 index c0901de..35ce460 100644 --- a/make_post_sell/templates/crypto_checkout.j2 +++ b/make_post_sell/templates/crypto_checkout.j2 @@ -372,13 +372,21 @@ expiresEl.parentNode.style.display = 'none'; } } else if (currentStatus === 'confirmed' || currentStatus === 'confirmed-overpaid') { - // Payment confirmed - replace with invoice link and redirect + // Payment confirmed - replace with invoice link replaceButtonsWithInvoiceLink(data.invoice_url); // Hide countdown if (expiresEl && expiresEl.parentNode) { expiresEl.parentNode.style.display = 'none'; } + + // Redirect only if status changed from non-confirmed to confirmed (via polling) + // Don't redirect if user browsed directly to already-confirmed quote + if (lastKnownStatus && lastKnownStatus !== 'confirmed' && lastKnownStatus !== 'confirmed-overpaid' && data.redirect_url) { + setTimeout(() => { + window.location.href = data.redirect_url; + }, 2000); // 2 second delay to show confirmation message + } } else if (terminalStatuses.includes(currentStatus)) { // Terminal status - replace with invoice link replaceButtonsWithInvoiceLink(data.invoice_url);