glv19
glv19

Reputation: 486

Generating Braintree client token in advance

I'm looking to reduce the response time for a payment page using the Braintree Drop-In UI (JS v3 SDK).

When a user visits the payment page, I'm generating the client token in PHP as per the docs here:

https://developers.braintreepayments.com/reference/request/client-token/generate/php

This request seems to be slowing things down with the token sometimes taking a while to generate.

I was wondering if there are any issues with generating tokens in advance and storing them on my server to speed things up?

I'm aware that tokens can not be re-used from this question here:

Braintree client token expiration

Is anyone aware of any issues as long as the token is discarded from the server once used. I can't seem to find any details of expiration of client tokens in the Braintree docs.

Thanks.

Upvotes: 0

Views: 1229

Answers (1)

Raj
Raj

Reputation: 489

Include Braintree class and write below code to generate client token.This code will generate client token only if you will set merchant details and secret key details .

Braintree_ClientToken::generate();

Upvotes: 0

Related Questions