braintree / braintree_php_example

An example Braintree integration for PHP
MIT License
126 stars 94 forks source link

[BraintreeSDK] ERROR Invalid client token. Please ensure your server is generating a valid Braintree ClientToken. #21

Closed firepmi closed 7 years ago

firepmi commented 7 years ago

General information

Issue description

firepmi commented 7 years ago

I deployed php braintree on heroku I tried to get client token on the server but it says "[BraintreeSDK] ERROR Invalid client token. Please ensure your server is generating a valid Braintree ClientToken. [BraintreeSDK] ERROR BTClient could not initialize because the provided clientToken was invalid" here is my code

Please give me advise Thanks

bluk commented 7 years ago

When you log the client token, is there a value for the client token? Can the text response be base64 decoded? For iOS specifically, I would ensure that you're using a https URL since iOS 9+ requires additional App Transport Security configuration when talking to http URLs. I think Heroku serves all deployed apps over https for free if you use a Heroku subdomain, and it meet the App Transport Security requirements.

Sorry for the delay in response. You can contact support for specific integration information as well.

bluk commented 7 years ago

Closing due to inactivity. If this is still an issue, please leave a comment or contact (Braintree Support](https://developers.braintreepayments.com/forms/contact), and we'll reopen. Thanks!

juliorimo commented 6 years ago

Hi, we are getting the same error creating a BTAPIClient with the clientToken.

[BraintreeSDK] ERROR BTClient could not initialize because the provided clientToken was invalid [BraintreeSDK] ERROR Invalid client token. Please ensure your server is generating a valid Braintree ClientToken.

We are using: Braintree (4.17.0) and BraintreeDropIn (6.4.0)

Thx!