I'm designing an e-commerce application and I'm concerned about users occasionally experiencing this:
- A user orders a product and is redirected to the payment processor.
- While the user is paying, another user orders the product and it's now out of stock.
- The user completes payment, but the order can't be created because the product is out of stock.
This can be avoided by reserving the product before attempting payment. But there's some complexity in doing so - if the payment fails, products need to be un-reserved, and a timeout is needed in case the user never completes the payment process.
So my question: is it worth implementing the reserve process? Or is this scenario rare enough to just not worry about it and resolve things manually if it does happen?
The answers probably depends on exactly what's being sold. However, I don't know this - I'm developing generic software to be used by all sorts of vendors. I could make it configurable, but still need a sensible default.
The answers probably depends on exactly what's being sold
It depends entirely on what is being sold and how the business handles orders when inventory is low. It's not a problem if you sell silkscreened shirts and can make them on-demand, but it's a huge problem if you sell electronics produced in China and the manufacturer requires a two-month lead time.