I am busy writing code to use a third party service to process payments. A very short wait after the user submits their payment, the service calls a URL on my site to send a payment confirmation message. I want to display a view that informs the user I am waiting for this message, and then redirects to the next step in my sign-up process.
How can I go about this? The simplest that comes to mind is using a JavaScriptResult, which returns null while the process is still busy, and then returns redirection code when the process has completed. Is this a a good way of doing this?
You would create a View that contains JavaScript which polls a service with Ajax calls. In the meantime you would display a spinner or similar item.
As soon as the Ajax call returns “success”, your JavaScript method then redirects to the “Success” page.