Everything Cut Short: Need to execute a function after around 5 minutes after a request sent by Google Checkout's Notification Service.
Why: The History API requires the transaction to be atleast 5 min old to work.
What has been tried, suspending teh function by sleep, but it generates a TIMEOUT error at google's end.
Main Concern: The function must run, even if the user navigates away from page, reloads the page, or closes his/her browser or logout from the Site..
Tried, Google but not of much use.. Any Ideas??
This sounds like a job for cron. Here's a possible implementation outline:
The cron job can be set to run at any interval you like. The lower the interval, the more quickly History API requests will be made as Checkout Notifications hit the 5 minute age. Your cron script can record the result of the History API request in your database so that your web interface can retrieve it and show it to the user.