diff --git a/src/pages/billing/SubscriptionTab.tsx b/src/pages/billing/SubscriptionTab.tsx index 413f798..29ad357 100644 --- a/src/pages/billing/SubscriptionTab.tsx +++ b/src/pages/billing/SubscriptionTab.tsx @@ -350,14 +350,21 @@ export const SubscriptionTab: React.FC = ({ mandateId }) = if (sessionId && !verifyCalledRef.current) { verifyCalledRef.current = true; - verifyCheckout(sessionId) - .then((result) => { + const _pollUntilActive = async (retries = 5, delayMs = 2000) => { + try { + const result = await verifyCheckout(sessionId); if (result.status === 'activated') { setCheckoutMessage({ type: 'success', text: 'Abonnement wurde aktiviert.' }); setJustPaid(false); + return; } - }) - .catch(() => {}); + } catch { /* handled below via retry */ } + if (retries > 0) { + await new Promise(r => setTimeout(r, delayMs)); + await _pollUntilActive(retries - 1, delayMs); + } + }; + _pollUntilActive(); } } else if (params.get('canceled') === 'true') { setCheckoutMessage({ type: 'info', text: 'Checkout abgebrochen. Ihr bestehendes Abonnement bleibt aktiv.' });