I've created a IPN code that allows paypal to update my database for a item purchased. I am thinking ahead though that the person buying my item, might not confirm upon checkout, or that while they are confirming check out, someone else might click the buy it now button as well before it's confirmed via paypal.
The point to all this is, I want to figure out the best way to fix this. My idea is after they click the buy now button it sets the item to pending, and they have 5 minutes to confirm the purchase or it's sent back to available.
Please help.. I can provide my code if needed.
I'd suggest using something like Resque - there is a PHP port (https://github.com/chrisboulton/php-resque).
If you don't want to use Resque, then you could do something a bit more simple like a cron job that selects all products that with a status of 'reserved' where the status was set more than 5 minutes ago. Then you change that status to 'available' again. You can run that cronjob every 60 seconds.
However, this can get into complicated race conditions, and it will be less flexible, so I'd implement a queue-based system if you can.