Larder, online pantry shop · Programming
Checkout fails for some carts
Larder sells pantry goods online. Storefront release 142 went out at 10:34, and since then about one checkout in eight ends with “We couldn’t take payment.” Those customers are not charged, and most of them do not try again.
I’ve tried three times to buy the olive oil and a tub of the sea salt. Every time it says you couldn’t take payment, but my bank shows nothing pending. The same card worked here last week.
Your objective
Find out why the payments service declines these checkouts, fix the storefront code that causes it, and ship the fix. The incident closes when production checkouts stop failing and Maya’s order goes through in the shop.
Getting started
- Maya’s cart is still saved in the support view. Open the cart, check out, and copy the reference from the error.
- Search the logs for that reference. The payments service records why it declined the charge.
- Compare the amount the storefront sent with the amount payments expected. Then read pricing.js and docs/pricing.md in Code.
- Fix the function, run the tests, and deploy. Then place Maya’s order again and watch the success rate.
Resolution
- No checkout fails with amount_mismatch for 30 seconds of production trafficStarting
- Maya’s order (one olive oil, one sea salt, no code) is confirmed in the shopStarting
How this lab runs
Larder runs in this page. The storefront code in the editor prices every order, yours and the simulated customers’. Payments, inventory, and orders are simulated services with measured latencies, and every log line, trace, and chart point comes from a request this page processed.