{"id":1651,"date":"2025-10-22T16:11:14","date_gmt":"2025-10-22T16:11:14","guid":{"rendered":"https:\/\/www.getuniqu.com\/paiement-reussi\/"},"modified":"2026-03-10T03:14:48","modified_gmt":"2026-03-10T03:14:48","slug":"paiement-reussi","status":"publish","type":"page","link":"https:\/\/www.getuniqu.com\/fr\/paiement-reussi\/","title":{"rendered":"Paiement r\u00e9ussi"},"content":{"rendered":"\n<div style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; text-align: center; padding: 3rem; max-width: 500px; margin: 4rem auto; background: white; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.1);\">\n    <div style=\"width: 80px; height: 80px; background: #10b981; border-radius: 50%; margin: 0 auto 1.5rem; display: flex; align-items: center; justify-content: center; font-size: 48px; color: white;\">\u2713<\/div>\n    <h1 style=\"color: #1f2937; font-size: 28px; margin: 0 0 0.5rem;\">Paiement r\u00e9ussi !<\/h1>\n    <p style=\"color: #6b7280; font-size: 16px; margin: 0 0 1rem;\">Redirection vers la cr\u00e9ation de votre compte&#8230;<\/p>\n    <div style=\"width: 40px; height: 40px; border: 4px solid #e5e7eb; border-top-color: #667eea; border-radius: 50%; animation: spin 1s linear infinite; margin: 1.5rem auto;\"><\/div>\n<\/div>\n\n<style>\n    @keyframes spin {\n        to { transform: rotate(360deg); }\n    }\n<\/style>\n\n<script>\nconsole.log('\ud83d\udd04 Payment success page loaded');\n\n\/\/ Get plan from URL\nconst urlParams = new URLSearchParams(window.location.search);\nconst plan = urlParams.get('plan') || 'core';\nconst session = urlParams.get('session');\n\n\/\/ Detect provider: check URL parameter first, then fallback to session presence\nlet provider = urlParams.get('provider');\nif (!provider) {\n    \/\/ Fallback: if we have a session parameter, it's likely PPG (LS doesn't use session)\n    provider = session ? 'payproglobal' : 'lemonsqueezy';\n}\n\nconsole.log('\ud83d\udce6 Plan:', plan);\nconsole.log('\ud83d\udcb3 Provider:', provider);\nconsole.log('\ud83c\udfab Session:', session);\n\n\/\/ BREAK OUT OF IFRAME: Only for PayProGlobal (LS doesn't use iframes)\nif (provider === 'payproglobal' && window.top !== window.self) {\n    console.log('\ud83d\udeaa Breaking out of PayProGlobal iframe');\n    \/\/ Get the current URL and redirect the top window\n    const currentUrl = window.location.href;\n    window.top.location.href = currentUrl;\n    \/\/ Stop execution here - the page will reload outside iframe\n} else {\n    \/\/ Original logic for non-iframe or LemonSqueezy\n    \/\/ Retrieve session token from localStorage (same domain as marketing site)\n    const sessionToken = localStorage.getItem('uniqu_checkout_session');\n\n    if (sessionToken) {\n        console.log('\u2705 Session token found:', sessionToken);\n        \n        \/\/ Build redirect URL with token\n        const redirectUrl = `https:\/\/app.getuniqu.com\/create-account?plan=${plan}&token=${sessionToken}`;\n        \n        console.log('\ud83d\udd17 Redirecting to:', redirectUrl);\n        \n        \/\/ Redirect after short delay (allows user to see success message)\n        setTimeout(() => {\n            \/\/ Break out of iframe only for PayProGlobal\n            if (provider === 'payproglobal' && window.top !== window.self) {\n                window.top.location.href = redirectUrl;\n            } else {\n                window.location.href = redirectUrl;\n            }\n        }, 1500);\n        \n    } else {\n        console.error('\u274c No session token found in localStorage');\n        \n        \/\/ Redirect anyway after 3 seconds (they can still create account)\n        setTimeout(() => {\n            const fallbackUrl = `https:\/\/app.getuniqu.com\/create-account?plan=${plan}`;\n            \/\/ Break out of iframe only for PayProGlobal\n            if (provider === 'payproglobal' && window.top !== window.self) {\n                window.top.location.href = fallbackUrl;\n            } else {\n                window.location.href = fallbackUrl;\n            }\n        }, 3000);\n    }\n}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>\u2713 Paiement r\u00e9ussi ! Redirection vers la cr\u00e9ation de votre compte&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_analytify_skip_tracking":false,"footnotes":""},"class_list":["post-1651","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.getuniqu.com\/fr\/wp-json\/wp\/v2\/pages\/1651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.getuniqu.com\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.getuniqu.com\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.getuniqu.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.getuniqu.com\/fr\/wp-json\/wp\/v2\/comments?post=1651"}],"version-history":[{"count":3,"href":"https:\/\/www.getuniqu.com\/fr\/wp-json\/wp\/v2\/pages\/1651\/revisions"}],"predecessor-version":[{"id":504925,"href":"https:\/\/www.getuniqu.com\/fr\/wp-json\/wp\/v2\/pages\/1651\/revisions\/504925"}],"wp:attachment":[{"href":"https:\/\/www.getuniqu.com\/fr\/wp-json\/wp\/v2\/media?parent=1651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}