I'm having strange issues with PayPal integration - It used to work fine for years and all of a sudden it started returning this error: Authentication failed due to invalid authentication credentials or a missing Authorization header. This is my server side code $environment = new ProductionEnvironment( PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET ); $client = new PayPalHttpClient( $environment ); $request = new OrdersCreateRequest(); $request->body = [ 'intent' => 'CAPTURE', 'purchase_units' => [ [ 'reference_id' => $reference_id, 'description' => $item_description, 'amount' => [ 'value' => $price_ILS . '.00', 'currency_code' => 'ILS' ] ] ], 'application_context' => [ 'brand_name' => 'XXXXXXXX', 'locale' => 'he-IL', 'shipping_preference' => 'NO_SHIPPING' ] ]; $response = $client->execute( $request ); The strange thing is that if I'm changing my PAYPAL_CLIENT_ID & PAYPAL_CLIENT_SECRET to another app credentials that I created previously, then it will work for a few times and then it will stop working with that annoying error: "Authentication failed due to invalid authentication credentials or a missing Authorization header." I don't know what is going on, how come it's working just for a short time and then it stop working? I have paypal debug ids that retuned with that error: [paypal-debug-id] => f6eb25fe35041 [paypal-debug-id] => 184062b37434b I think it is similar to this issue: https://www.paypal-community.com/t5/Sandbox-Environment/Authentication-failed-due-to-invalid-authentication-credentials/m-p/2955185#M9725 (Only I'm having this problem in production)
... View more