Braintree 使用托管字段更新支付方式数据

Braintree use hosted fields to update payment method data

我将 Braintree 与 NodeJS 和 AngularJS 结合使用,需要更新支付方式数据。出于安全和验证的考虑,我想使用托管字段,但是 Braintree SDK 的 paymentMethod.update() 方法要求卡片数据以这样的形式传递:

gateway.paymentMethod.update(payMethodToken, {
    cardholderName: req.body.update.name,
    cvv: req.body.update.cvv,
    expirationDate:  req.body.update.exp
}

似乎无法从托管字段中获取此数据。那么,有没有办法以某种方式将提交的托管字段中的数据转换为我可以传递给 paymentMethod.update() 的数据?如果没有,更新付款方式数据的另一种安全方法是什么?

完全披露:我在 Braintree 工作。如果您有任何其他问题,请随时联系 support.

托管字段阻止您与信用卡号或 cvv 进行交互。相反,如果您想更新用户的付款信息,请使用您希望与该付款方式关联的 paymentMethodNonce, using the nonce your client receives from Braintree upon form submission. Optionally, you may also include non-Hosted Field information 调用更新。