Safe payment retries using server order IDs

thetshaped.dev7 min read

The author explains how to design a reliable payment endpoint that safely handles retries without double-charging customers. The approach relies on keying payments to a server-created order ID rather than a per-click request, using a database unique index instead of a check-then-insert pattern to claim processing rights, and treating every retry as a replay with stored card data and request leases. Open article →