In my website I direct user to the 3ds payment page. And when all the things done with 3ds it redirects me to my website succesfully. But, when an user presses the go back button, it shows 3ds page. I want to redirect user as if the user nevers visits the 3ds page. My tech stack is ReactJS and react router dom. I have an array routes that consists of components and I use switch like that:
<Switch>
{
routes.map(route => <Route key={route.id} {...route} />)
}
</Switch>
So how can I redirect back page as if he never visited 3ds page? Can I overwrite go back button in browser?
Edit:
<form method="post" action="https://host/fim/Nestpaygate">
<input type="hidden" name="clientid" value="990000000000001"/>
<input type="hidden" name="storetype" value="3d" />
<input type="hidden" name="hash" value="iej6cPOjDd4IKqXWQEznXWqLzLI="
/> <input type="hidden" name="islemtipi" value="Auth" />
<input type="hidden" name="amount" value="91.96" /> <input
type="hidden" name="currency" value="949" /> <input
type="hidden" name="oid" value="1291899411421" />
<input type="hidden" name="okUrl" value="https://www.teststore.com/success.php" /
> <input type="hidden" name="failUrl" value="https://www.teststore.com/fail.php"
/> <input type="hidden" name="lang" value="tr" />
<input type="hidden" name="rnd" value="asdf" />
<input type="hidden" input name="pan" value="4242424242424242">
<input type="hidden" input name="Ecom_Payment_Card_ExpDate_Year" value="28" >
<input type="hidden" input name="Ecom_Payment_Card_ExpDate_Month" value="10">
</form>
This is exactly how I redirect my user to the 3ds page. When user inputs all his/her infos, I send a post request using html form because this is how document they sent tells me to do. Then user completes succesfully or fails payment. 3Ds page sends a post request to the one of 2 urls in my backend, ie. okUrl and failUrl in html form. And then reflects whatever my response is into the screen. I cannot get any response from my endpoints since response goes to the 3ds page which I have no control. So, I decided to return html as string which directs user to the my website in fact exactly where he/she left.