The double order
A customer on slow hotel wifi taps Pay twice. They are charged twice and get two orders.
This answers: How do I stop duplicate orders from double clicks? No coding needed. 3 quick decisions.
- How a request travels
- Payments and webhooks
- Where your data lives
Checking your access…
How do I stop duplicate orders from double clicks?
Give each purchase intent an and store it with a unique constraint in the database. When the same key arrives again, return the first result instead of creating a second order. Disabling the button helps, but retries, refreshes and second tabs still send duplicates.
Breaks at Your server: Two taps become two orders
How it works
- 0sStripeSends evt_1Q8: 'checkout completed'
- 0–31sYour serverAdds one month of credits… but replies slowly
- 31sStripeNo reply in time, so it sends evt_1Q8 again
- 31sYour serverAdds a second month of credits
Why AI tools write this bug
Generated checkout code usually creates an order on every request. Duplicate handling is invisible in testing, because you only click once.
How to fix it
- Generate one per purchase attempt on the client.
3 more steps, and a prompt that checks your own app for this bug. Part of Pro.
UnlockCommon questions
- What does idempotent mean?
- Doing the operation twice has the same effect as doing it once.