What is the best way of spitting out the view file in codeigniter and still doing some work on the server? The situation basically is:
- I have a payPal checkout where user goes to paypal and clicks Pay Now! A set_express_checkout() is called to start things off.
- The user is returned to the Thank You page.
- I have to call a Get_express_checkout_details() and a do_checkout() before showing him the Thank you page and this is 2 calls to a pretty slow payPal server.
My problem is, that when the user clicks on Pay Now! button, he is redirected back to my site but hangs at payPal for at least 5 seconds (while my server makes the 2 requests) before he can se anything. So the question is: Where should I make these two calls so the user doesnt have to wait so long before anything is shown to them?