I have a Single Page Application (SPA) built with DurandalJS v1.2 that integrates with a payment gateway. The SPA will go off to the payment gateway's page by doing a normal form POST to their page.
Once the user has finished on the payment gateways page, the payment gateway will then do a form POST back to my SPA.
Since it's a POST, I handle it server side in ASP.NET MVC by rendering out a require.js module definition for the various form parameters being sent, and this module is then used in the view model that needs to handle the result.
This is all working fine, I handle the result, and then stay on the same SPA page. This is different to the typical web pattern of Post-Redirect-Get, since the SPA doesn't do any redirects.
The issue now is when pressing the browser refresh button, it's bringing up the browser's retry post confirmation dialog (which I don't want).
Is there a way to avoid this by using JavaScript, or is the PRG pattern the only way?
Note: It appears that changing window.location, document.location, as well as using history.replaceState all do not work (at least in Chrome).