Review this Java payment endpoint. Clients send an Idempotency-Key header to make charge creation safe to retry.
Idempotency-Key