function Checkout({ go, onPaid, plan = 'yearly' }) { const wide = useWide(); const [step, setStep] = React.useState('select'); // select | pay | success const [coin, setCoin] = React.useState('USDC'); const [copied, setCopied] = React.useState(false); const [countdown, setCountdown] = React.useState(14 * 60); // 14 minutes React.useEffect(() => { if (step !== 'pay') return; const id = setInterval(() => setCountdown(c => c > 0 ? c - 1 : 0), 1000); return () => clearInterval(id); }, [step]); const price = plan === 'yearly' ? 800 : 99; const total = price + 1.20; const coins = [ { sym: 'BTC', name: 'Bitcoin', amt: plan === 'yearly' ? '0.01124' : '0.00139', net: 'Bitcoin' }, { sym: 'ETH', name: 'Ethereum', amt: plan === 'yearly' ? '0.2178' : '0.02697', net: 'Ethereum' }, { sym: 'USDC', name: 'USD Coin', amt: total.toFixed(2), net: 'Any supported chain' }, { sym: 'SOL', name: 'Solana', amt: plan === 'yearly' ? '4.235' : '0.524', net: 'Solana' }, { sym: 'USDT', name: 'Tether', amt: total.toFixed(2), net: 'Ethereum ยท Tron ยท Solana' }, ]; const sel = coins.find(c => c.sym === coin); const addr = 'bc1q8nx5m7t3v9q2p4r6s8u0w1y3z5a7c9e1g3i5k7m9o1q3s5u7w9y1a3c5e7'; const copy = () => { navigator.clipboard?.writeText(addr); setCopied(true); setTimeout(() => setCopied(false), 1500); }; const mm = Math.floor(countdown / 60).toString().padStart(2,'0'); const ss = (countdown % 60).toString().padStart(2,'0'); if (step === 'success') { return (
PAYMENT CONFIRMED ON-CHAIN
Welcome to the desk.
Your membership is active. A receipt is on its way to your email. Let's get you into the tools.
{ onPaid(plan); go('home'); }} style={{ padding: '14px 24px' }}>Enter dashboard โ†’
); } return (
{/* Whop-style faux header */}
W
SECURE CHECKOUT BY WHOP
๐Ÿ”’ TLS ยท RATE LOCKED
{/* Left: payment */}
{step === 'select' ? ( <>
STEP 1 OF 2 ยท CHOOSE ASSET
Pay with crypto
{coins.map(c => (
setCoin(c.sym)} style={{ display: 'flex', alignItems: 'center', gap: 14, padding: '14px', border: `1px solid ${coin === c.sym ? TH.accent : TH.rule}`, background: coin === c.sym ? TH.panelHi : 'transparent', marginBottom: 8, cursor: 'pointer', }}>
{c.sym}
{c.name}
{c.net}
{c.amt} {c.sym}
${total.toFixed(2)}
))} setStep('pay')} style={{ width: '100%', padding: 14, marginTop: 14 }}>Continue with {coin} โ†’ ) : ( <>
STEP 2 OF 2 ยท SEND PAYMENT
โฑ {mm}:{ss}
Send exactly {sel.amt} {sel.sym}
{/* Faux QR */}
{Array.from({length: 21*21}).map((_, i) => { const x = i % 21, y = Math.floor(i / 21); const corner = (x < 7 && y < 7) || (x > 13 && y < 7) || (x < 7 && y > 13); const cornerInner = (x >= 2 && x <= 4 && y >= 2 && y <= 4) || (x >= 16 && x <= 18 && y >= 2 && y <= 4) || (x >= 2 && x <= 4 && y >= 16 && y <= 18); if (corner && !(x === 0 || x === 6 || x === 14 || x === 20 || y === 0 || y === 6 || y === 14 || y === 20)) { return cornerInner ? : null; } const on = ((x * 7 + y * 13 + (x^y)) % 3) === 0; return on ? : null; })} {/* Corner squares */} {[[0,0],[14,0],[0,14]].map(([x,y],i) => ( ))}
{sel.name.toUpperCase()} ADDRESS
{addr}
{copied ? 'โœ“ Copied' : 'โŽ˜ Copy address'}
โš  SEND ONLY {sel.sym} ON THE {sel.net.toUpperCase()} NETWORK
โš  AMOUNT MUST MATCH EXACTLY โ€” WHOP AUTO-CONFIRMS ON 1 BLOCK
setStep('success')} style={{ width: '100%', padding: 14 }}> I've sent the payment โ€” verify โ†’
setStep('select')} style={{ textAlign: 'center', fontFamily: TH.mono, fontSize: 11, color: TH.inkSoft, marginTop: 12, cursor: 'pointer', letterSpacing: 1 }}>โ† CHANGE ASSET
)}
{/* Right: order summary */}
ORDER
Walkforward Membership
{plan.toUpperCase()} ยท AUTO-RENEW
{plan === 'yearly' ? 'Yearly plan' : 'Monthly plan'}${price}.00
Network fee$1.20
Total${total.toFixed(2)}
โœ“ 30-DAY REFUND VIA WHOP
โœ“ CANCEL ANY TIME
โœ“ INSTANT ACCESS ON CONFIRMATION
go('pricing')} style={{ fontFamily: TH.mono, fontSize: 11, color: TH.inkSoft, marginTop: 14, cursor: 'pointer', letterSpacing: 1, textAlign: 'center' }}> โ† BACK TO PRICING
); } Object.assign(window, { Checkout });