Scenario C · Same key, different body
The same Idempotency-Key arrives with another amount. Reusing a key for a different payment is a client bug, so it is rejected. Answer: 422.
IdempotencyReserver method opens its own); amber boxes: alternative branches.What to look for
- The hash is checked before the status, so a different body gets 422 even while the original is still PROCESSING.
- Without this check the server would replay the 150.00 response for a 999.00 request, hiding the client's mistake.
- The hash is SHA-256 of the JSON body as Jackson serializes
PaymentRequest.