← Case studies

Lights Canada Case Study #1: Eliminating Payment Race Conditions

Four payment gateways running simultaneously created a silent but costly bug: customers clicking Pay twice, or networks retrying, resulted in duplicate charges and double orders. The fix involved client-side idempotency keys, pessimistic database locking during inventory reservation, and a processed-event table that made webhook handlers safe to call multiple times without side effects.

Google Doc

Open in new tab →