Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Braintree client token expiration

Tags:

braintree

In Braintree, When I generate a client token with a $customerId, how reliable is it to save that client token to database and re-use it later on?

I always have a user corresponding to a $customerId and it would greatly reduce the number of calls to Braintree if I could re-use the token.

Does the token ever expire? There is no mention of that in the official docs.

Thanks a lot!

like image 779
Pavel Denisjuk Avatar asked Mar 12 '23 17:03

Pavel Denisjuk


2 Answers

Full disclosure: I work as a developer for Braintree

The client token is not intended to be reused and will be revoked if a single client token is used multiple times in a short time span. You can read more about the client token in this part of the Braintree documentation. ​

like image 172
Kathryn Exline Avatar answered May 14 '23 13:05

Kathryn Exline


This was a thing before 2019. In 2019 they changed the client token behavior so now it is granted for 24 hours and can be reused unless it was granted for specific CustomerId https://www.braintreepayments.com/blog/changes-to-client-tokens-are-coming/

like image 42
Artem Nizelnyk Avatar answered May 14 '23 13:05

Artem Nizelnyk