Reputation: 48443
I would like to automatically redirecta a user after successful payment to my own "thank you" page. Currently I am working with Paypal under the sandbox account and on my localhost.
Is there any way to do it? I tried to browse through the admin account in sandbox, but I didn't find something useful...
Upvotes: 1
Views: 9977
Reputation: 3418
You simply need to add a "return" variable to your button.
If you're manually creating the button, it's just a hidden field named "return" with value set to your Thank You page. Eg:
<input type="hidden" name="return" value="http://www.mysite.com/thanks.html"/>
If you're using an encoded button, then you can set this in the button wizard page of the PayPal site.
From PayPal's Payments Standard documentation [ https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables ] (It's quite long so just do a search for "return") :
return
The URL to which PayPal redirects buyers’ browser after they complete their payments. For example, specify a URL on your site that displays a “Thank you for your payment” page.
Default – PayPal redirects the browser to a PayPal webpage.
Upvotes: 2