Paypal Integration With Yii Question

I have a website that list multiple items for sale. I would like to use paypal to sell stuff on it. The only problem is, when I have 1 item left, how can I avoid the clash if two people plan to buy it at the same time. Let’s say Person A adds the item X to his cart. And after 30 second Person B adds the item to his Cart. Now person A is going to check out and is filling out his paypal information while Person B also presses checkout. How can I avoid that ? I know that I can remove the item from the listing the moment one of them is in the checkout stage, but again what If someone goes all the way to checkout page and just close his browser and never buy the item ? I appreciate it if anyone can suggest a solution that solves this issue and also give flexibility to people during shopping online.

Hi there is a paypal ext

That’s a painful situation for the customers that can happens everywhere. If I were you, under the check out button, I would put a red warning saying how many people is currently viewing or checking out this particular item and the other customers should hurry and there is risk that they cant purchase it. Knowing the risks they either rush to buy or expect the site to run out of the item, which is acceptable. Obviously, before check out with paypal, you would check your database for that item.