Reputation: 1082
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.
Upvotes: 2
Views: 720
Reputation: 1528
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.
Upvotes: 3
Reputation: 8508
Just glancing over the API (seriously how many API's does Paypal have) I think IPN is your best option. Why? Because it is the most reliable way to know that you have money in your pocket.
With any online system you may encounter over ordering but that's just part of the business. The only way to help with this is to do a quantity check just before charging the customer.
Upvotes: 0