PageSourceSearch

https://careerplatform.io/assets/checkout.return-BcRCwGW4.js

js careerplatform.io collected 2026-10-02 01:59:36 UTC 4,615 bytes, 1 lines download raw bytes

1import{aP as u,r as d,j as e,L as i}from"./index-P6gp-aZt.js";import{g as l}from"./payments.functions-D5o8Mh9L.js";import{a as x}from"./stripe-BL9TlFig.js";function a(t){if(typeof window>"u")return;const r=new URL(window.location.href);r.searchParams.get("status")!==t&&(r.searchParams.set("status",t),window.history.replaceState({},"",r.toString()))}function m(t,r){if(typeof window>"u")return;const n=window;n.__caree_conv_fired=n.__caree_conv_fired||{},!n.__caree_conv_fired[t]&&(n.__caree_conv_fired[t]=!0,n.dataLayer=n.dataLayer||[],n.dataLayer.push(r))}function p(t){m(t.sessionId,{event:"purchase_success",transaction_id:t.sessionId,value:t.amount!=null?t.amount/100:void 0,currency:t.currency??void 0})}function h(t){m(t,{event:"trial_start",transaction_id:t})}function b(){const{session_id:t}=u.useSearch(),[r,n]=d.useState({kind:"loading"});return d.useEffect(()=>{if(!t){n({kind:"missing"}),a("error");return}let c=!1;return(async()=>{try{const o=x(),s=await l({data:{sessionId:t,environment:o}});if(c)return;if("error"in s){n({kind:"error",message:s.error}),a("error");return}if(s.status==="expired")return a("expired"),n({kind:"expired"});if(s.status==="open")return a("cancelled"),n({kind:"open"});s.paymentStatus==="paid"||s.paymentStatus==="no_payment_required"?(n({kind:"paid",email:s.customerEmail,amount:s.amountTotal,currency:s.currency}),a("success"),s.paymentStatus==="paid"&&(s.amountTotal??0)>0?p({amount:s.amountTotal,currency:s.currency,sessionId:t}):h(t)):(n({kind:"unpaid"}),a("unpaid"))}catch(o){c||(n({kind:"error",message:o instanceof Error?o.message:"Could not verify payment"}),a("error"))}})(),()=>{c=!0}},[t]),e.jsx("div",{className:"min-h-screen flex items-center justify-center px-6",children:e.jsxs("div",{className:"max-w-md w-full p-8 rounded-2xl border border-border bg-card text-center",children:[r.kind==="loading"&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Verifying your payment…"}),r.kind==="missing"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"No session found"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"We couldn't find your checkout session. If you were charged, contact support."}),e.jsx(i,{to:"/pricing",className:"text-primary hover:underline text-sm",children:"Back to pricing"})]}),r.kind==="paid"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4 size-12 rounded-full bg-emerald-500/20 text-emerald-500 flex items-center justify-center text-2xl",children:"✓"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Payment complete"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:r.amount!=null&&r.currency?`${(r.amount/100).toFixed(2)} ${r.currency.toUpperCase()} charged${r.email?` to ${r.email}`:""}.`:"Thanks for your purchase."}),e.jsx("p",{className:"text-xs text-muted-foreground mb-6",children:"It can take a few seconds for new credits and limits to appear."}),e.jsx(i,{to:"/dashboard",className:"inline-block px-5 py-2.5 rounded-lg bg-primary text-primary-foreground font-bold text-sm hover:opacity-90",children:"Go to dashboard"})]}),r.kind==="open"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Checkout still open"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"We haven't received payment yet. You can return to pricing and try again."}),e.jsx(i,{to:"/pricing",className:"text-primary hover:underline text-sm",children:"Back to pricing"})]}),r.kind==="expired"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Checkout expired"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"The checkout session has expired. Please start again."}),e.jsx(i,{to:"/pricing",className:"text-primary hover:underline text-sm",children:"Back to pricing"})]}),r.kind==="unpaid"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Payment not completed"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Stripe reports the session was not paid. If you believe this is an error, contact support."}),e.jsx(i,{to:"/pricing",className:"text-primary hover:underline text-sm",children:"Back to pricing"})]}),r.kind==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Couldn't verify payment"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:r.message}),e.jsx(i,{to:"/dashboard",className:"text-primary hover:underline text-sm",children:"Go to dashboard"})]})]})})}export{b as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.