In my recent grails project, i needed to return back to the application after processing payment at the paypal website. I searched a lot about it. Then i found the solution to do so and thought it worth sharing.
Here are the steps i followed:-
1. The Paypal button:-
This is the code for putting the paypal button in any web-page
The email of merchant’s account or the seller account, the account to which payment is to be made and the email by which the account is registered is given in the hidden field “business”.
The URL to which we want application to return after processing payment is provided in the hidden field with the name “return” i.e.
This completes the application side implementation for paypal.
2. Paypal Account Configuration
Now we have to configure the Merchant’s account to Auto-redirect to the provided URL after processing the payment.
Steps to configure account are:-
1. Log in to Paypal Account
2. Click the Profile Link in sub-menu of My Account.
3. Under “Selling Preferences” click ‘Website Payment Preferences’ link.
4. Select the Auto-Return radio button to enable the auto return feature.
This enables the auto-redirect feature in the paypal account.
This worked for me.
Hope it helps.