Just retry.
Every request creates a charge.
- Total charged
- $0.00
- Charges
- 0
PAYMENT LEDGER
- No transactions yet.
A customer pays $49. The payment succeeds. The response never arrives. Your app retries. What happens next?
A simulated checkout. No real payments. No network requests.
ORDER TOTAL $49.00
Ready. No requests sent.
Every request creates a charge.
PAYMENT LEDGER
Same intent. Same idempotency key.
PAYMENT LEDGER
Unintended extra charges: $0.00
The provider processed the first payment, but your app never heard back. If the app sends the retry as a new payment, the provider can charge the same customer again.
Give the payment a stable idempotency key and reuse it on retry. A provider that honors the key can recognize the original request and return its outcome. In production, store the intent and its outcome, and handle concurrent requests, key expiry, payload changes, and reconciliation.
Keep a test that drops the first response and retries, then checks that the ledger shows a single charge.
How we build with AI