I need to redirect PayPal Service to a page after it gets accepted by user. The page I want to redirect follows the following structure:
- Me.aspx
- \Paypal\Accept.aspx
- \Paypal\Cancel.aspx
- \Paypal\Finish.aspx
so if I’m on http://localhost:63000/myfolder/me.aspx
I want to be redirected by PayPal to http://localhost:63000/myfolder/paypal/accept.aspx
How?
Ok. Got it working!
I can use HttpContext.Current to get my current Url and then rewrite current page to the subdirectory and page:
ReturnURL = HttpContext.Current.Request.Url.AbsoluteUri.ToLower().Replace("me", "PayPal/Accept")If HttpContext.Current.Request.Url.AbsoluteUri is
http://localhost:63000/myfolder/me.aspxthen ReturnURL ishttp://localhost:63000/myfolder/PayPal/Accept.aspx, and PayPal sandbox returns properly.