Ecommerce Managing product inventory during payments
Posted: Mon Apr 20, 2009 2:23 pm
Hey guys I need some advice...
I am building a shopping cart system and when the payment process is done the product quantity needs to be updated. How can I prevent a scenario where by a customer A is in the mist of purchasing a quantity of products that were available probably 10 seconds before customer B came and JUST bought an amount that would probably deplete the products quantity to a minimum that cannot supply customer A's purchase?
thus
customer a and b see that there are 10 of the same item available
customer A chooses to buy 5
customer B ends up buying 6 right before customer A's transaction goes through
I was thinking to lock the product but i'm not sure how that is possible...
What is usually done?
I am building a shopping cart system and when the payment process is done the product quantity needs to be updated. How can I prevent a scenario where by a customer A is in the mist of purchasing a quantity of products that were available probably 10 seconds before customer B came and JUST bought an amount that would probably deplete the products quantity to a minimum that cannot supply customer A's purchase?
thus
customer a and b see that there are 10 of the same item available
customer A chooses to buy 5
customer B ends up buying 6 right before customer A's transaction goes through
I was thinking to lock the product but i'm not sure how that is possible...
What is usually done?