Reputation: 1378
I have site with paypal payments. I use IPN for processing payments
I want to visitors return to specific page after paypal payment
I put in basket form
<input type="hidden" name="return" value="http://site.com/basket/thank-you?param=value">
Pair param=value could be specific in some cases
But after payment visitors only see paypal "Thanks for your order" page :( Visitors could use return link on this page, but they wouldn't do it :)
I know that it is possible to set auto return in PayPal merchant account-->profile-->Selling Preferences-->Website Payment Preferences-->Auto Return for Website Payments
But there I should set only one url. So I have to use cookies or session to catch users language. Why is it so? Why return link hidden field doesn't work? Is it possible to get return functionality without PDT?
Upvotes: 1
Views: 1551
Reputation: 1378
The most interesting thing that I have problem with return filed only in Sandbox. On real paypal account I have visitors returned on thank-you page even with auto return option switched off.
Upvotes: 0
Reputation: 26036
When using Payments Standard like you are, users are never guaranteed to make it back to your return even with Auto-Return enabled. They could simply close the browser before the auto-return happens, for example. It's not very reliable at all.
If you want to make sure users get back to your app flow then you can use Express Checkout. This involves 3 API calls, SetExpressCheckout, GetExpressCheckoutDetails, and DoExpressCheckoutPayment.
After signing in, review and agreeing to the payment, the user will be sent back to the ReturnURL you specify in SetExpressCheckout. At this point you can call GetExpressCheckoutDetails to obtain payer details (optional) and then finalize everything using DoExpressCheckoutPayment.
I would also recommend saving data to your database or using session variables as oppose to URL parameters, which will be easily accessible since Express Checkout takes place on your own server instead of PayPal's.
Upvotes: 1
Reputation: 3187
By setting the Auto Return for Website Payments
on your Website Payment Preferences
to ON does not mean that your application will always use the Return URL on it. You can still override it by specifying the return
field like what you have done above:
<input type="hidden" name="return" value="http://site.com/basket/thank-you?param=value">
The difference is only that the visitors will be directly redirected to the return URL (usually waiting for about 10 seconds) without take them into "Thanks for your order" page.
Upvotes: 0