Braintree.js 插入,动态更新客户端令牌?

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

我正在使用 braintree.js,并加载他们的插件。一切正常,但我无法提交第二个请求,因为需要一个新的 nonce 值。

一切都在 js 中完成 - 我正在提交 nonce 值并获得一个新令牌。但是新的 nonce 值仅与新的客户端令牌一起返回,因此是否可以在不刷新页面的情况下更新当前加载的 form/drop-in 正在使用的客户端令牌?

您可以通过Braintree Vault创建客户端令牌并生成braintree令牌并传递它。你可以按照这个程序

# 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

我在 Braintree 担任开发人员。目前,您无法在不重新加载页面的情况下动态更新客户端令牌。

这是一个已知问题,团队正在为未来版本积极制定解决方案。我建议订阅 this GitHub issue,这样您就会收到任何相关更新的通知。