[PHP] I followed step by step the Smart Buttons Integration and installed the SDK. placed my client Id on the client side (SANDBOX) <script src="https://www.paypal.com/sdk/js?client-id=<my clienT id here>"></script> and placed my clientid and secret in the sdk file $clientId = getenv("CLIENT_ID") ?: "<MY CLIENT ID>"; $clientSecret = getenv("CLIENT_SECRET") ?: "MY CLIENT SECRET"; and copy pasted the php code for server side ; https://developer.paypal.com/docs/checkout/integrate/#6-verify-the-transaction but when i print the promise ; onApprove: function(data, actions) { return actions.order.capture().then(function(details) { alert('Transaction completed by ' + details.payer.name.given_name); // Call your server to save the transaction return fetch('paypal-transaction-complete.php', { method: 'post', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ orderID: data.orderID }) }).then(function(res){ console.log(res.text()); //HERE I PRINT PROMISE IN CONSOLE }); }); } i get this error : Fatal error: Uncaught exception 'PayPalHttp\HttpException' with message '{"error":"invalid_client","error_description":"Client Authentication failed"} Isnt the SDK supposed to deal with the authentication ? I'm stuck please help !
... View more