“How do you design an idempotent payment processing endpoint that prevents double-charging under network retries?”
Enforce unique idempotency keys generated on client requests, stored in a fast transactional datastore with atomic distributed locks, and return cached response payloads on repeated requests.
Relying solely on frontend button disabling without backend idempotency guarantees.