How real companies do itLesson 031 min
How does Stripe stop you being charged twice?
A payment request can succeed on the server while the reply is lost, so the app retries and risks a second charge. Stripe's fix is an idempotency key: the app attaches a random code, and Stripe saves the first result under it. A repeat with the same code returns the saved result instead of charging again.
Remember
Make retries safe: doing it twice should have the same effect as once.
