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.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 */}
{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 });