Find the flawPayments
Charged once, even when the app retries
The payment call times out and the client retries. How do you make sure the customer is charged once?
The design you’re given
- The app retries a payment after 10 seconds without a reply
- App → Payment service: POST /payments {to, amount}
- Each request creates a new payment and moves the money
- On mobile networks, about 1 in 200 replies is lost after the money moved