New to the community? Welcome! Please read our Community Rules and Guidelines
If you want to report illegal content under the EU Digital Services Act, please do so here
My MERCHANT_ID is: 58V2NEF27DY7E
I downloaded the latest CheckoutNETSDK and replaced environment() method body with my Sandbox client_id and secret obtained directly from my PayPal developer account page so that it didn't get them from the environment. I also refreshed the secret several times.
I then ran the RunAllCaptureIntentFlow Sample
but I get the error:
System.AggregateException: 'One or more errors occurred.
({"error":"invalid_client","error_description":"Client Authentication failed"})'
I traced execution through to the method: PayPalHttpClient AuthorizationInjector fetchAccessToken() where it failed on the return statement:
AccessTokenRequest request = new AccessTokenRequest(environment, refreshToken); this.client.Execute(request); return executeTask.Result;
The request had the following content:
{Method: POST, RequestUri: 'https://api.sandbox.paypal.com/v1/oauth2/token', Version: 2.0, Content: System.Net.Http.FormUrlEncodedContent, Headers:{ Authorization: Basic QWVNM1E2R25HTyAtIGNPcFJZcmJURTFBTnBNOTBCQmFOV3U2b25tM0p6bDduaHQ3TlJsQVRwY0czQ2FLOG44WVdCMWdRNWZxQkliekxBYmxKUjpFSGlBNXROZ0F2M0FxRFFfajFpUF9mWFVEemZtX3lWOWM3dlBSb1MtUm9QNFUxMHFETHNYZjR5UGg2Mkpqc3VIMlJOZVp5UjN1ZnNjcmlaNP== Accept-Encoding: gzip User-Agent: PayPalSDK/PayPal-NET-SDK User-Agent: 2.0.0-rc2 User-Agent: ( lang=DOTNET; v=4.0.30319.42000; clr=4.0.30319.42000; bit=64; os=Microsoft Windows NT 6.2.9200.0) Content-Type: application/x-www-form-urlencoded Content-Length: 29 } }
The details of the error are:
System.AggregateException
HResult=0x80131500
Message=One or more errors occurred. ({"error":"invalid_client","error_description":"Client Authentication failed"})
Source=System.Private.CoreLib
StackTrace:
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at PayPalCheckoutSdk.Core.PayPalHttpClient.AuthorizationInjector.fetchAccessToken() in C:\Users\howar_000\Documents\Visual Studio 2017\Projects\Checkout-NET-SDK-master\PayPalCheckoutSdk\Core\PaypalHttpClient.cs:line 62
at PayPalCheckoutSdk.Core.PayPalHttpClient.AuthorizationInjector.Inject(HttpRequest request) in C:\Users\howar_000\Documents\Visual Studio 2017\Projects\Checkout-NET-SDK-master\PayPalCheckoutSdk\Core\PaypalHttpClient.cs:line 51
at BraintreeHttp.HttpClient.<Execute>d__10.MoveNext()
Inner Exception 1:
HttpException: {"error":"invalid_client","error_description":"Client Authentication failed"}
N.B. I have edited the Authorization so no one can use my account
Any ideas why my client_id would be failing authentication?