Includes: API (Express/TypeScript), Astro site, Python workers, document generators, FCC compliance tools, Canada CRTC formation, Ansible infrastructure, and deployment scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 line
2 KiB
JavaScript
1 line
2 KiB
JavaScript
import"./hoisted.yFz1BYXO.js";const i=window.__PW_API||"https://api.performancewest.net";function c(t){return new URLSearchParams(window.location.search).get(t)??""}const d=c("order_id"),l=c("order_type")||"canada_crtc",m=c("expedited")==="1",s=document.getElementById("cancelled-order-id");s&&d&&(s.textContent=`Order ID: ${d}`);if(m){document.querySelectorAll("#retry-methods > label").forEach(r=>{const n=r.querySelector("input[type='radio']");n&&n.value!=="paypal"&&n.value!=="crypto"&&(r.classList.add("hidden"),n.checked=!1)});const t=document.querySelector('input[name="retry_method"][value="paypal"]');t&&(t.checked=!0);const e=document.getElementById("expedited-retry-note");e&&e.classList.remove("hidden")}document.getElementById("btn-retry-payment")?.addEventListener("click",async()=>{const t=document.getElementById("btn-retry-payment"),e=document.getElementById("retry-status"),r=document.querySelector('input[name="retry_method"]:checked')?.value||"card";t.disabled=!0,t.textContent="Redirecting...",e&&(e.textContent="Creating checkout session...",e.classList.remove("hidden"));try{const n=await fetch(i+"/api/v1/checkout/create-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({order_id:d,order_type:l,payment_method:r})}),o=await n.json(),a=o.url||o.checkout_url||o.redirect_url;if(n.ok&&a)e&&(e.textContent="Redirecting to payment..."),window.location.href=a;else throw new Error(o.error||"Failed to create checkout session")}catch(n){e&&(e.className="mt-3 text-sm text-red-600 text-center",e.textContent=n.message||"Something went wrong. Please try again.",e.classList.remove("hidden")),t.disabled=!1,t.innerHTML='<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"/></svg> Retry Payment'}});
|