{"id":1648,"date":"2025-10-22T16:11:14","date_gmt":"2025-10-22T16:11:14","guid":{"rendered":"https:\/\/www.getuniqu.com\/pagamento-riuscito\/"},"modified":"2026-06-21T01:50:14","modified_gmt":"2026-06-21T01:50:14","slug":"pagamento-riuscito","status":"publish","type":"page","link":"https:\/\/www.getuniqu.com\/it\/pagamento-riuscito\/","title":{"rendered":"Pagamento riuscito"},"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\t<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;  \">\n  \u2713\n\t<\/div>\n\t<h1 style=\"color: #1f2937; font-size: 28px; margin: 0 0 0.5rem\">Pagamento riuscito!<\/h1>\n\t<p style=\"color: #6b7280; font-size: 16px; margin: 0 0 1rem\">\n  Ti stiamo reindirizzando per creare il tuo account&#8230;\n\t<\/p>\n\t<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\t@keyframes spin {\n\t\tto {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}\n<\/style>\n\n<script>\n\t(function () {\n\t\tconst BRIDGE_VERSION = 'ppg-www-success-bridge-2026-06-21-v2-postmessage-xparams';\n\t\tconsole.log('\ud83d\udd04 Payment success page loaded');\n\t\tconsole.log('\ud83c\udf09 Bridge version:', BRIDGE_VERSION);\n\n\t\tconst urlParams = new URLSearchParams(window.location.search);\n\t\tconst session = urlParams.get('session') || urlParams.get('x-sessiontoken');\n\n\t\tconst tokenFromUrl = session;\n\t\tconst tokenFromLocalStorage = localStorage.getItem('uniqu_checkout_session');\n\t\tconst tokenFromCookie = getCookie('uniqu_ppg_token');\n\t\tconst sessionToken = tokenFromUrl || tokenFromLocalStorage || tokenFromCookie;\n\n\t\tlet provider =\n\t\t\turlParams.get('provider') || urlParams.get('x-checkoutprovider') || getCookie('uniqu_ppg_provider');\n\t\tif (!provider) {\n\t\t\tprovider = tokenFromUrl || tokenFromCookie ? 'payproglobal' : 'lemonsqueezy';\n\t\t}\n\n\t\tconst plan = urlParams.get('plan') || urlParams.get('x-plantype') || getCookie('uniqu_ppg_plan') || 'core';\n\t\tconst product =\n\t\t\turlParams.get('product') ||\n\t\t\turlParams.get('x-productid') ||\n\t\t\turlParams.get('products[1][id]') ||\n\t\t\tgetCookie('uniqu_ppg_product');\n\t\tconst status = urlParams.get('status') || 'success';\n\n\t\tconsole.log('\ud83d\udce6 Plan:', plan);\n\t\tconsole.log('\ud83d\udcb3 Provider:', provider);\n\t\tconsole.log('\ud83c\udfab Session:', session);\n\t\tconsole.log('\ud83d\uded2 Product:', product);\n\t\tconsole.log('\ud83d\udccc Status:', status);\n\t\tconsole.log('\ud83e\ude9f In iframe:', window.top !== window.self);\n\t\tconsole.log('\ud83c\udfab Token from URL session:', tokenFromUrl);\n\t\tconsole.log('\ud83c\udfab Token from localStorage:', tokenFromLocalStorage);\n\t\tconsole.log('\ud83c\udfab Token from cookie:', tokenFromCookie);\n\n\t\tif (sessionToken) {\n\t\t\tconsole.log('\u2705 Session token found:', sessionToken);\n\t\t} else {\n\t\t\tconsole.error('\u274c No session token found in URL, localStorage, or cookie');\n\t\t}\n\n\t\tconst redirectUrl = new URL('https:\/\/app.getuniqu.com\/create-account');\n\t\tredirectUrl.searchParams.set('plan', plan);\n\t\tredirectUrl.searchParams.set('status', status);\n\t\tif (provider) redirectUrl.searchParams.set('provider', provider);\n\t\tif (sessionToken) redirectUrl.searchParams.set('token', sessionToken);\n\t\tif (product) redirectUrl.searchParams.set('product', product);\n\n\t\tconsole.log('\ud83d\udd17 Redirecting to:', redirectUrl.toString());\n\n\t\tsetTimeout(function () {\n\t\t\tredirectOutOfBridge(redirectUrl.toString());\n\t\t}, sessionToken ? 1500 : 3000);\n\n\t\tfunction redirectOutOfBridge(url) {\n\t\t\tconst payload = {\n\t\t\t\ttype: 'ppg-checkout-result',\n\t\t\t\tstatus,\n\t\t\t\tredirectUrl: url\n\t\t\t};\n\n\t\t\tif (window.opener && !window.opener.closed) {\n\t\t\t\twindow.opener.postMessage(payload, '*');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (window.parent && window.parent !== window.self) {\n\t\t\t\twindow.parent.postMessage(payload, '*');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twindow.location.href = url;\n\t\t}\n\n\t\tfunction getCookie(name) {\n\t\t\tconst escapedName = name.replace(\/[.*+?^${}()|[\\]\\\\]\/g, '\\\\$&');\n\t\t\tconst match = document.cookie.match(new RegExp('(?:^|; )' + escapedName + '=([^;]*)'));\n\t\t\treturn match ? decodeURIComponent(match[1]) : null;\n\t\t}\n\t})();\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>\u2713 Pagamento riuscito! Ti stiamo reindirizzando per creare il tuo account&#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-1648","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.getuniqu.com\/it\/wp-json\/wp\/v2\/pages\/1648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.getuniqu.com\/it\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.getuniqu.com\/it\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.getuniqu.com\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.getuniqu.com\/it\/wp-json\/wp\/v2\/comments?post=1648"}],"version-history":[{"count":6,"href":"https:\/\/www.getuniqu.com\/it\/wp-json\/wp\/v2\/pages\/1648\/revisions"}],"predecessor-version":[{"id":505314,"href":"https:\/\/www.getuniqu.com\/it\/wp-json\/wp\/v2\/pages\/1648\/revisions\/505314"}],"wp:attachment":[{"href":"https:\/\/www.getuniqu.com\/it\/wp-json\/wp\/v2\/media?parent=1648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}