StoicBuilder

HandbookIII the CastraPayments

IIIthe Castra, Stay in control

Payments

1 min readUpdated 28 November

In plain words

Taking payments means a provider like Stripe, Polar or Lemon Squeezy handles the card, while your server confirms what was paid before granting access.

Where you see it

QuickBite sends the customer to a Stripe Checkout page, then back to /success. That page loading proves nothing about payment, because anyone can type the address.

app/api/checkout/route.tsserver
const session = await stripe.checkout.sessions.create({ mode: "payment", line_items: [{ price: item.stripePriceId, quantity }], success_url: `${origin}/success?session_id={CHECKOUT_SESSION_ID}`, cancel_url: `${origin}/cart`,});
The price ID comes from your database, not from the browser.

What goes wrong

  1. Unlocking the order on the success page

    Anyone can open /success without paying. Mark orders paid only when your server hears from Stripe through a verified webhook.

  2. Letting the browser set the price

    Pass along whatever amount the request contains, and sooner or later someone sends amount: 1. Look up the price on the server.

    unit_amount: body.amount
  3. Testing only in test mode, then flipping to live

    Live mode has its own keys, products, prices and webhook endpoints. Launch day is a bad time to find one missing.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Create Stripe Checkout sessions on the server using price IDs stored in our database, never amounts sent from the browser. Mark orders paid or grant access only from a verified webhook, not the success page, and list what I need to set up separately in live mode.

Quick check

Sign in to earn +10 XP for it

A Quill user gets Pro without paying by visiting /success directly. What's the fix?

Got a prompt that touches payments?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.