PayPal.IdentityException: The remote server returned an error: (401) Unauthorized.

tekspace
Contributor
Contributor
I am using REST API of pay pal. My application is working fine with sandbox but when i press Live and get client Id and secret from developer account then i am getting this error on payment process of credit card.
 
The remote server returned an error: (401) Unauthorized.
   at PayPal.Api.PayPalResource.ConfigureAndExecute[T](APIContext apiContext, HttpMethod httpMethod, String resource, String payload, String endpoint, Boolean setAuthorizationHeader)
   at PayPal.Api.Payment.Create(APIContext apiContext, Payment payment)
   at PayPal.Api.Payment.Create(APIContext apiContext)
 
Please guide me about this error it is related to what?
 
Thanks
Login to Me Too
1 REPLY 1

tekspace
Contributor
Contributor

I had to set Mode = Live 

private Dictionary<string, string> GetConfig()
{
var properties = ConfigManager.Instance.GetProperties();
if (properties["mode"] != null)
{
properties["mode"] = _mode;
}
else
{
properties.Add("mode", _mode);
}
return properties;
}

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.