I have a weird issue: I have a drop in UI configured as a donation form in a Wordpress theme.
Everything looks good, i can connect to the gateway, but i have a problem getting the client token. To be more specific i get this error:
name: "DropinError"
message: "There was an error creating Drop-in."
_braintreeWebError: r
name: "BraintreeError"
code: "CLIENT_INVALID_AUTHORIZATION"
message: "Authorization is invalid. Make sure your client token or tokenization key is valid."
type: "MERCHANT"
details: undefined
General information
Issue description
I have a weird issue: I have a drop in UI configured as a donation form in a Wordpress theme. Everything looks good, i can connect to the gateway, but i have a problem getting the client token. To be more specific i get this error:
The response is the following:
token: "{"version":1,"authorizationFingerprint":"...","configUrl":"https://api.braintreegateway.com:443/merchants/.../client_api/v1/configuration","graphQL":{"url":"https://payments.braintree-api.com/graphql","date":"2018-05-08"},"challenges":[],"environment":"production","clientApiUrl":"https://api.braintreegateway.com:443/merchants/.../client_api","assetsUrl":"https://assets.braintreegateway.com","authUrl":"https://auth.venmo.com","analytics":{"url":"https://client-analytics.braintreegateway.com/..."},"threeDSecureEnabled":true,"paypalEnabled":false}"
However, sometimes it works and in the response I only get the token.
This is where i'm getting the token in js:
And this is the clientToken.php file:
Any ideas?