Clien authentication failed
acuz
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Feb-07-2020
07:23 AM
[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 !
1 REPLY 1
MTS_Jennifer
Moderator
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb-21-2020
12:38 PM
Hello,
Thank you for posting to the PayPal Merchant Technical Support Community.
You may want to do a var dump to see if your correct credentials are being passed in. If the credentials are not being passed in correctly then you will receive the Client Authentication Failed message. Also verify that you are not storing your credentials with a space before or after. A space will be seen as a character and can cause Client Authentication Failed message.
Thank you,
Jennifer
PayPal
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Problem setting up Third-Party API Users in NVP/SOAP APIs
- I Have PayPal API Billing Authentication Failure Python-Flask in REST APIs
- Totally confused about implementing a "modern" PayPal interface in Sandbox Environment
- AUTHENTICATION FAILURE in REST APIs
- When trying to authentication to the REST API in production I get an invalid_client error in REST APIs