简体   繁体   中英

Braintree.js drop-in , dynamically update client token?

I'm using braintree.js, and loading their drop-in. Everything works fine but I'm unable to submit a second request because a new nonce value is needed.

Everything is done in js- I'm submitting the nonce value and getting a new token. But a new nonce value is returned only with a new client token, so is it possible to update the client token the current loaded form/drop-in is using, without refreshing the page?

I work as a developer at Braintree. Currently, you cannot dynamically update a client token without a page reload.

This is a known issue and the team is actively working on a solution for a future release. I recommend subscribing to this GitHub issue so you will be notified of any pertinent updates.

You can create the client token by Braintree Vault and generate the braintree token and pass it. You can follow this procedure

# With this the PaymentMethod will be associated with the Customer
    result = braintree.PaymentMethod.create({
        "customer_id": customer.customer_id,
        "payment_method_nonce": nonce
    })
    token = result.payment_method.token

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM