I've integrated PayPal Rest API in my ASP.NET c# application. Uptil now I was working with localhost for my local enviroment. I was testing through my sandbox account. On my local environment everything works fine. PayPal returns me correct approval URL. Here is my code var guid = Convert.ToString((new Random()).Next(100000));
var createdPayment = this.CreatePayment(apiContext, baseURI + "guid=" + guid, payment);
var links = createdPayment.links.GetEnumerator();
string paypalRedirectUrl = null;
while (links.MoveNext())
{
Links lnk = links.Current;
if (lnk.rel.ToLower().Trim().Equals("approval_url"))
{
paypalRedirectUrl = lnk.href;
}
} On my local solution PayPal returns Sandbox link as per below: https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-3JB10334ST833345D#/checkout/login which returns me to PayPal page as expected But When I upload this application on my live server, this code returns me following url: http://dev.myDomain.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-5TN94291D37925436 This returns me to my domain not to PayPal Page. Is it anything wrong with my code or Sandbox solution doesn't work on live server? should I use live account for live server?
... View more