Click here to Skip to main content
15,867,141 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How can I Redirect a page Automaticaly after completing transaction in paypal.

i have following code in c#
C#
//If transactioin has been successfully performed, redirect SuccessURL page- this page will be designed by developer
redirectUrl += "&return=" + ConfigurationManager.AppSettings["SuccessURL"].ToString();

//If transactioin has been failed, redirect FailedURL page- this page will be designed by developer
redirectUrl += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString();

Response.Redirect(redirectUrl);


<pre lang="c#">
 <appSettings>  
    <add key="FailedURL" value="http://localhost:5519/paypalSetting.aspx"/> 
    <add key="SuccessURL" value="http://localhost:5519/paypalSetting.aspx"/>
  </appSettings>
Posted
Comments
Tom Marvolo Riddle 30-Apr-14 2:21am    
Please explain bit more
thedinesh01 30-Apr-14 2:43am    
when user click donate button in may page it connects to the paypal website and when the user complete the transaction i want it back to my website?
Tom Marvolo Riddle 30-Apr-14 3:47am    
oh sorry dinesh(i just notice that).You cannot check payment gateway with localhost
thedinesh01 30-Apr-14 7:40am    
i tried the other for eg. google.com but id doesnot work as well..
thedinesh01 30-Apr-14 7:53am    
will you help me to find solution of this.. i am really having nightmare doing this...:(

1 solution

OP Wrote:
when user click donate button in may page it connects to the paypal website and when the user complete the transaction i want it back to my website?


You should include the return page in the redirection page itself.

Before redirecting to payment gateway,some mandatory fields are passed from the website to the payment gateway which includes return page.After transaction ,the return page will be called automatically by the gateway system.

Better contact a Payment gateway service provider.In this case, they know more than us

You have to take Griff's answer[^] seriously .

Refer here to get an idea:
Introduction to PayPal for C# - ASP.NET developers[^]
PayPal Gateway Integration in ASP.NET[^]
Use of the PayPal payment system in ASP.NET[^]

and see this too:
payment gateway in MVC .net project[^]
 
Share this answer
 
v2
Comments
Volynsky Alex 30-Apr-14 5:03am    
Nice
Tom Marvolo Riddle 30-Apr-14 5:09am    
Thank you Volynsky Alex.
Volynsky Alex 30-Apr-14 7:21am    
You're welcome
thedinesh01 30-Apr-14 7:42am    
i tried but it does now work you can see i have provided the return page to them as well. you can see the code as well..
Tom Marvolo Riddle 5-May-14 13:35pm    
sorry for the late reply. you can't work with payment gateway in localhost

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900