This question is more conceptual than technical and I can't seem to find a good solution. I am developing a high-traffic eCommerce site using chained payments and the Adaptive Payments API.
At what point during the sale and subsequent paypal transaction should my site subtract inventory in order to prevent over ordering?
Many of the open source e-commerce sites I've come across appear to subtract inventory only once the IPN is received and confirmed; however, on a high-traffic site this could produce over ordering of a product if seperate buyers purchase the same item within a close time frame. On the other hand, if the inventory is reduced before payment is received, how long should it wait to void the unpaid order and re-stock the inventory? What would be the best solution?
Thank you in advance for any advice on this subject.
We are using the following process;
As I mentioned, the 3hr session timeout isn't ideal so we are considering using Embedded Payment Flow Using Adaptive Payments which will allow us to use javascript to keep track of the session time, and force a page refresh if they have taken long than say 30mins.
I would love to hear if a better solution exists from someone at Paypal though. Ideally it would be better if we could implement an "Express Checkout" style pay call once the user returned to the site, rather than relying on IPN to complete the order.