Larder, online pantry shop · Programming
Some customers were charged twice
Larder’s card processor has been answering slowly since 10:30. Since then customers have written in about two charges for one order, and the nightly reconciliation job has started finding charges with no order behind them. Nothing in the storefront was deployed at 10:30.
My card shows two charges of $41.70 from Larder this morning, a few seconds apart. I placed one order and got one confirmation email. Please refund the second one. I order from you every month, so I’d like to know it won’t happen again.
Your objective
Stop the storefront from charging a card more than once, refund the customers who were already overcharged, and confirm in the shop that an order on the slow test card is charged once. The processor team is working on its latency, and it stays slow for the whole incident.
Getting started
- In the support view you are signed in as Ruth. Open Orders, then her order from 10:39, and read the processor charges under it.
- Copy her checkout id and search the logs for it. Compare the idempotency key on each charge attempt, then read docs/payments-api.md in Code.
- Check out on the processor test card to see it happen. Read charge.js and the storefront releases; the change that matters went out before 10:30.
- Fix chargeCheckout, run the tests, and deploy. Refund the extra charges in Releases and config, then pay with the test card again.
Resolution
- No card is charged twice, or charged without an order, for 30 seconds of production trafficStarting
- Every extra charge taken so far is refundedStarting
- An order on the processor test card confirms with exactly one chargeStarting
How this lab runs
Larder runs in this page. The storefront code in the editor charges every order, yours and the simulated customers’. The card processor is simulated: it keeps one charge per idempotency key, finishes a charge after the storefront has stopped waiting, and has been slow since 10:30. Every log line, trace, refund, and chart point comes from a request this page processed.