I need to redirect when my site is loading.
When a user is clicking the “Buy” button in my webshop.asp cart page, I send the info to the payment service and they load my start page with a querystring(paymentId) and then I want to load my webshop.asp cart again to show the “Payment success” info to the user.
I want it to work like this:
When the payment service loads my start page I then check to see if it is loaded with a querystring called paymentId, and if it is then redirect and load the webshop.asp page.
So this is what I have now, but the mainView.router.navigate("/kundvagnen/",{ignoreCache: true});
is not redirecting?
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};
thepaymentID=getUrlParameter('paymentId');
if(thepaymentID){
console.log('paymentId has a value '+thepaymentID)
mainView.router.navigate("/kundvagnen/",{ignoreCache: true});
}
So why isn´t mainView.router.navigate("/kundvagnen/",{ignoreCache: true});
redirecting - working?
Thanks a lot.