
How Idempotency Works
How to retry a payment safely without charging the customer twice
What you'll learn
- Why retries are dangerous for payments
- What makes an operation idempotent
- Idempotency keys and saving the result
- Handling duplicates that arrive at once, and Stripe's approach
In this video, we'll look at what happens when a payment succeeds but the response is lost and the app retries, and how idempotency stops the customer from being charged twice. We'll cover idempotency keys, how the server handles repeated requests, and how to deal with two copies of a request arriving at the same time.
We'll also look at how Stripe uses idempotency keys to make payment retries safe.



