Skip to content
Founding beta: 7 of 50 free spots leftClaim yours

A failed payment still ended up in the balance and on the customer's card

Bug huntMediumPython · FastAPIDatabasePaymentsAPI50 min

PAY-2412: Balance is $324 too high after last Friday, and a customer was charged for an order that "failed"

Ticket #33020 · email · High

Component: Payments / balance (support's guess)

From: Ben Okafor, finance and operations, Harbor Lane Coffee · Received: Mon 26 Oct, 7:55 am

Our weekly check of the Paylane balance against the orders we marked as paid doesn't add up: Paylane says we have about $324 more than our own books. I went through Friday evening, when our checkout showed "Something went wrong, please try again" to seven customers between 6 and 7 pm (UTC, our shop runs on UTC). Five of them tried again straight away and paid fine, the other two gave up. Those seven payments are not marked as succeeded in the Paylane dashboard, but their money seems to be in our balance anyway. One customer, Mei, sent me her bank statement: she was charged for the order that failed and for the retry, so she paid twice. We can't refund these because Paylane says the payments never succeeded. We had a problem with our webhook receiver that same evening, so maybe that's related? Please sort out the balance, make sure this can't happen again, and tell me what you need from us for the seven payments.

Ben

Support note (Aiko, tier 2): I found the seven in the account: all stuck at "requires confirmation", no succeeded event, but each has a charge in the balance list. I checked the receiver theory: webhook sending is queued separately and does not take part in confirming a payment. Ops says the database was very busy Friday between 6 and 7 pm (the nightly report job started early) and its statement timeout was cancelling queries. I attached the application log for that hour and an export of the balance next to the payment status of each charge. The seven payments in the log were made with different orders and different idempotency keys, so it isn't a double click on the checkout page.

Attachments: attachments/api-2026-10-23.log (application log, Friday 18:00 to 19:00 UTC), attachments/balance-vs-payments-2026-10-23.csv (balance charges, Friday 18:00 to 19:00 UTC, with the status of the payment each belongs to).

Ask: work out how money and balance can end up recorded for a payment that the API answered with an error, and fix it, so a payment that fails leaves no trace in the balance and no charge on the customer's card. Payments that succeed must keep working exactly as today.

© AICodingRound. Ticket text for practice on this site; see Terms.

How it works

  1. 1Fix the problemin a real codebase.
  2. 2Use your ownAI, or none.
  3. 3Submit, then answera few short questions.
  4. 4Get your gradeand feedback.

More on Paylane payments

View all

Related problems

View all