Redirect is currently immediate. Is there a way to hold it for 5 seconds and then in between a Prompt should come that we are directing you to Paypal. Prompt should come Just beyond the button.
console.log(resp);
window.location.href = "https://www.paypal.com/cgi-bin/webscr?&c=_xclick&business=email@gmail.com¤cy_code=USD&amount=95&item_name=visaconsultancycontribution";
setTimeout(function(){ alert("You will be redirected to Paypal"); }, 5000);
},
I think that the time is set, but that alert prompt is not appearing.
I think a prompt confirm messagebox would be better than an alert message box. Because it stops script execution you could put the location change inside it and do away with the settimeout altogether.
Messageboxes may not be as elegant as page elements but I think most users are familiar with them.
The flow would be like
AJAX returns successfully
user sees a type of “continue, yes or no?”
the user then has control of both whether or not they continue and when it happens