Stripe

Stripe Payment Went Through but the Customer Didn't Get Access? Stop Unlocking on the Success Page

8 min read · Updated November 1, 2026 · Checked against official docs

A very common pattern in AI-built apps goes like this: the Stripe checkout sends the buyer back to /success, and the code on that page marks them as paid. It works every time you test it. Then real customers show up, and two things go wrong:

  1. Someone pays and never gets access. They closed the tab, their phone lost signal, or the redirect failed, so /success never loaded.
  2. Someone gets access without paying. If the page unlocks the account just because it loaded, anyone who types /success into the address bar gets in.

Stripe’s own docs are blunt about the first one:

You can’t rely on triggering fulfillment only from your checkout landing page, because it’s not guaranteed customers visit that page. (Stripe: Fulfill orders)

The fix in one sentence

Let Stripe tell your server about the payment with a webhook, and grant access there. The success page just says thanks and shows what the buyer already has.

Step 1: Write one “fulfill” function on the server

Stripe recommends a single server-side function that unlocks whatever the customer bought. It takes the Checkout Session ID and must:

  1. Fetch the Checkout Session from Stripe’s API (with its line items).
  2. Check payment_status. Only fulfill if it isn’t unpaid.
  3. Grant access (set the user’s plan, send the download, and so on).
  4. Record that this session has been fulfilled.
  5. Be safe to run more than once. Stripe says it may be called several times, even at the same moment, for the same session. If it’s already been fulfilled, do nothing.

The important part is step 1. Your server asks Stripe directly what happened. It never trusts a “paid=true” flag from the browser or a URL.

Step 2: Call it from a webhook

Add a webhook endpoint (a Supabase Edge Function, a Vercel or Cloudflare function, or your server) that listens for:

  • checkout.session.completed: the normal “they paid” event.
  • checkout.session.async_payment_succeeded: for payment methods that settle later, such as bank debits. Their payment isn’t finished when checkout ends.

Both call your fulfill function with the session ID. Verify the webhook signature with your whsec_… secret before trusting the event. If verification keeps failing, our Stripe webhook signature guide covers the usual causes.

This applies to Payment Links too. Stripe says Payment Links use Checkout, so the same events fire.

Step 3: Make the success page read-only

You can still call the fulfill function from the success page for speed, since it’s safe to run twice. But the page should:

  • Get the session ID from the URL (?session_id={CHECKOUT_SESSION_ID} in your success URL).
  • Send it to your server, which checks with Stripe and fulfills if needed.
  • Never unlock anything on its own, and never trust anything in the URL except that ID.

If the webhook hasn’t finished yet, show “Payment received, setting up your account…” and refresh after a few seconds, instead of an error.

Step 4: Go live without breaking it

Test mode and live mode have separate webhook endpoints and signing secrets. When you switch to live:

  • Create the webhook endpoint in live mode for your production URL.
  • Put the live whsec_… secret in your production environment.
  • Make one real small purchase (and refund it) to watch the whole flow work.

A prompt for your AI tool

Audit how this app grants access after a Stripe payment.
1. Find any code that marks a user as paid or unlocks features on the
   success/thank-you page or from URL parameters. List each place.
2. Move fulfillment to a server-side webhook handler for
   checkout.session.completed and checkout.session.async_payment_succeeded
   that verifies the Stripe signature, retrieves the Checkout Session from
   the Stripe API, checks payment_status, and records the session ID so
   running it twice does nothing.
3. Make the success page only show status, reading it from our server.
Explain the plan before changing files. Never put the Stripe secret key or
webhook secret in browser code.

Quick self-test

  • Open /success in a private window without paying. Do you get access? If yes, it’s broken.
  • Pay in test mode, then close the tab before the success page loads. Do you still get access a few seconds later? If no, the webhook isn’t doing the job.
  • Resend the same event from the Stripe Dashboard. Does the customer get double credit or two emails? If yes, add the “already fulfilled” check.

Then run the pre-launch security checklist before you share the link.


Official sources used: Stripe: Fulfill orders · Stripe: Webhooks. Checked November 2026.

Ready to ship without guessing the next fix?

The Ship It Kit puts the prompts, deploy steps and pre-launch checklist in one place for Lovable, Bolt, Cursor and Replit apps. One-time $19. Launch price: $19 $17 until November 14, 2026.

Get the Ship It Kit, $19$17 See what's inside

Spotted something out of date? Platforms change their screens often. The official docs linked above are always the source of truth.