Scenario B · Retry with the same key
The client sends the same request again (for example after a timeout). The stored response is replayed and nothing is charged. Answer: 200 OK.
IdempotencyReserver method opens its own); amber boxes: alternative branches.What to look for
- The retry never reaches
PaymentService:/payments/executionsdoes not change. - The status code changes (201 → 200) but the body is identical, so the client can treat both as success.
- No write happens: one SELECT is enough.