Guides
Sign in

Guide · Security basics

Payments confirmed on your server: a success page isn’t proof anyone paid

When someone pays, your payment provider sends them back to your app, often to a page like /success. Anyone can open that page without paying, so it can’t be what marks an order paid. Your server has to hear it from the provider itself: a signed message, called a webhook, or a question your server asks the provider directly. Our checker can see which provider your app loads. It can’t see your server, so this one is yours to check.

Why a success page isn’t proof

A success page is just an address. A customer can bookmark it, share it, or type it in, and a front end that reads ?success=true believes whatever the address says. Stripe puts it plainly: “You can’t rely on triggering fulfilment only from your checkout landing page, because it’s not guaranteed customers visit that page” (Stripe docs). Razorpay says the same of its own checkout: “You must verify the signature on your server before fulfilling the order” (Razorpay docs).

Here’s what else goes wrong when the server doesn’t check:

  • Fake payment messages. Your webhook address is public. “Without verification, an attacker could send fake webhook events to your endpoint to trigger actions like fulfilling orders” (Stripe docs). Providers sign their messages, or let your server ask for a payment’s status, so your server can tell the real ones apart.
  • A price set in the browser. If your front end decides the amount, a visitor can change it before paying. Razorpay asks for an order your server creates first: “Payments made without an order_id cannot be captured and will be automatically refunded” (Razorpay docs). So an app that delivers anyway gives the order away. PayPal’s guide creates the order and captures the payment on your back end too (PayPal docs).
  • The same payment, twice. “Webhook endpoints might occasionally receive the same event more than once” (Stripe docs). If your code delivers on every message, one payment can unlock two orders. Store each event or payment ID you’ve handled, and skip the ones you’ve seen.

How do I check my app?

  1. Find the code that marks an order paid, gives access, or sends the product. Ask your AI tool: “Where does an order become paid in my app?”
  2. If that code runs in the browser, on a success page, after a redirect, or in a then() after the payment pop-up closes, it’s the problem this guide is about.
  3. If it runs on your server, check that it verifies the provider’s signature, or asks the provider for the payment’s status, before it does anything.
  4. Check that it remembers which payments it has already handled, so a repeated message does nothing.

Fix it

Prompt for Lovable, Bolt, Cursor or Claude Code

My app takes payments. Check how an order becomes paid, and fix what’s missing: 1) The browser must never mark an order paid: not a success page, not a ?success=true in the address, not a callback in my front end. 2) My server must create each order and set its price, then confirm each payment with the provider before delivering anything: for Stripe, a webhook whose signature I verify, or fetching the Checkout Session or PaymentIntent; for Razorpay, create the order with the Orders API, pass its order_id to Checkout, and verify the payment signature; for PayPal, create and capture the order on my server; for PayTabs, Telr, N-Genius, Tap or Checkout.com, their signature check or a server call to their order-status API. 3) Handling the same event twice must do nothing the second time: store each event or payment id and skip ones I’ve already processed. 4) Show me the code that does each step, or write it if it’s missing.

Test it with your provider’s test mode: pay once, send the same webhook event again if your provider lets you (Stripe’s dashboard can), and open your success page in a private window without paying. Neither should create a second order or a free one.

Card numbers belong in your provider’s form

The safest checkout never lets card numbers touch your code. Stripe’s Payment Element and Checkout, Razorpay Checkout, N-Genius hosted sessions, Checkout.com Flow, and PayTabs’ or Telr’s hosted pages draw the card fields themselves, inside a frame or on their own page. Stripe calls these low risk integrations, which collect payment details “directly to Stripe without it passing through your servers, reducing your PCI obligations” (Stripe docs). PCI is the set of card-security rules every business that takes cards has to follow.

AI tools sometimes draw a card form of their own instead: an input for the card number, the expiry and the security code, in your app’s code. Then card numbers pass through your page, and any script on it can read them. Stripe’s guide warns that a business handling card data directly “might be required to meet more than 300 security controls in PCI DSS” (Stripe docs).

Prompt for Lovable, Bolt, Cursor or Claude Code

My app has its own card-number field. Replace it with my payment provider’s hosted fields or hosted payment page (Stripe Payment Element or Checkout, Razorpay Checkout, N-Genius hosted session or pay page, PayTabs or Telr hosted page, Checkout.com Flow), so card numbers never touch my code or my server. Then remove any code that reads, stores, logs or sends card numbers.

PayTabs’ Managed Form is the one exception by design: its card fields sit on your own page and PayTabs’ script reads them. That’s allowed, but it means your page’s scripts matter more, so keep them few. Our report says so when it sees the Managed Form.

What this can’t tell you

We look for a payment provider’s script or address in your page and the scripts it loads: Stripe, Razorpay, Checkout.com, Tap, PayTabs, Telr, N-Genius or PayPal. We never open your payment pages, send a payment, or call your webhook, because on the apps this guide is about, opening a success page can be what marks an order paid. So the payments line is Check yourself, never Clear. It becomes Worth fixing when your public code looks like it does your server’s job: it writes “paid” to your database next to a sign of a payment coming back, it opens Razorpay Checkout with an amount and no order_id, or it creates or captures PayPal orders in the browser. We read these from minified code, so a page for your staff that marks cash orders paid can look the same. That’s why the report says “looks like”. The card line looks for signs of a card field in your own code, like a field marked for card numbers, and stays quiet when it sees your provider’s own fields. A mock checkout form in a demo can look the same, so it says “what looks like”. We don’t read code your app loads later, after a click.

Related