I am working on booking website. When any user come to site, select any date & time for booking and go to paypal for payment. Before going to paypal, I am adding this entry to booking, so any other user can not go for booking on that specific time for that date. Now if user does not make payment on paypal and stay idle. In this case that time gets blocked. I want user should have 10 minutes to make a payment on paypal. If time exceeds user should redirect to my website with any flag, so I can remove that booking and that time - date will be available for booking to users.
I can use cron job which can remove bookings which are in pending status in database for more than 10 mins. Major problem I am facing is
1) When I go to paypal for payment and stay idle, paypal automatically redirect after 5 min (giving error of session time out)
2) But when I go to paypal and log in with sandbox account and then stay idle, if after 5 min, I try to do any activity, it gives error of time out, and redirect to login screen of paypal. So it allow me to login again and proceed for payment.
By this way user can even pay after 1 hour. If I delete booking entry using cron, it will create conflict because payment is completed and there is no entry in database.
I want way to explicitly redirect user from paypal to my site after 10 mins.