The thing I wants to sell is one of its kind, for example, a specific wine bottle or a painting. It means there exists on only product of that particular type. I am using products and orders table as an example below. And payment method will be ONLY PayPal.
There are two things I want to handle:
1. When a user selects to buy a product, his order is generated and added to orders table with a field named like 'status' in orders table with value= 'pending' or something to indicate that payment has not been made yet. Then the user is sent to PayPal and in the meanwhile other person comes. HERE I do not want the other person to select that product for purchasing. This could be done simply by having a field in products table status='sale_in_process'. And when displaying product listing don't show the product with status='selected_for_sale'
or 'sold', and when payment is made change status='sold' in products table. This may work.
2. Another case is when one person selects to buy it and is sent to PayPal but
never makes the payment. His order is already generated in orders table with status of order as 'pending' and status field in 'products' table is 'selected_for_sale'. Now as that person won't make the payment the status will remain 'selected_for_sale' in products table.
I could use some cron job to reset the status to 'available' for product again but questions to be answered are:
1. WHEN it this resetting should be done?
2. How will I know that the person never completed the payment? Can it happen that for some reason the payment is delayed for 1-5 days (echecks possible with paypal?)
3. How much time I should wait before deleting the order and resetting the status of the product?
This is PayPal specific question and because after user is sent to PayPal we cannot control anything as in case onsite credit card processing.
Start Free Trial