Code AnalysisIntermediate 60s
Non-Idempotent Payment Retry Handler
Pseudo-code:
onPaymentCallback(payment_id, amount):
row = ledger.get(payment_id)
if row is None:
ledger.insert(payment_id, amount)
gateway.charge(payment_id, amount)
What is the failure mode when the callback is delivered twice?
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.