Novatours · Scandiweb · Full-stack developer · 2022 – 2023
The extra service nobody had bought
A cancelled payment was still creating work in the client's ERP
The problem
Adding an extra service at the second checkout step, continuing to payment, then cancelling, still created that service in the client's ERP. Nothing had been paid for and nothing was wrong on screen, but the ERP now believed a service existed, so operations downstream were working from a booking the customer had walked away from. Like most expensive bugs, it produced no error.
What I did
I traced it to where the request was being fired: the frontend sent it at confirmation time, before the transaction was actually resolved, so an intention was being treated as a fact. I moved the dispatch to the backend, behind the point where the order is genuinely settled, and added an idempotency key so a retry or a duplicate submission cannot create a second service.
The outcome
Services are created only for things that were actually bought, and the same request arriving twice is now harmless. The general lesson travels: dispatch on committed state, never on intent, and make the operation safe to repeat.
Built with
- PHP
- Pimcore
- React
- TypeScript
- ERP integration