Add the button, watch it decide
A few lines add the button. It checks which wallets this browser can pay with and shows only those.
<WhopElements elements={loadWhop()} environment="sandbox">
<Checkout plan="plan_wJDUgFCSe8uSz" returnUrl="https://nextjs-whop-express-checkout-demo.vercel.app/">
<ExpressCheckoutElement />
</Checkout>
</WhopElements>Pay with card
No wallet button shows on this demo, so every visitor pays through Whop's card form. Open it and pay with the test card below.
Verify on the server
The demo already checked this payment with Whop before showing the receipt. Ask Whop again and read its full answer, which comes from payments.retrieve.
Come back from Whop
When a payment finishes, Whop can send the buyer back to your page with the result in the address bar. These buttons open this page at the same address Whop would use.
Break it on purpose
Part A: give the button a plan that doesn't exist and see how Whop answers. A plan is the price of a product on Whop.
Part B: pay in the step 2 form with the decline card 4000 0000 0000 0002. The form shows the error itself, and onComplete never runs, so this page and the server never hear about a payment.
Same product, two shapes
Everything the demo does shows up here as you click through.