我正在使用Braintree的托管字段和Javascript。我能够成功进行成功的注册并发送付款随机数,但是我无法弄清楚如何让Braintree门户中已经有订阅的用户显示预先存储在Braintree Hosted字段中的信息(地址,信用卡的一部分等)。
最佳答案
托管字段中唯一的地址字段是邮政编码。您可能需要构建一个自定义表单来填充其他地址值。
您可以使用payment method lookup从服务器中获取保险柜数据。然后,您可以在“托管字段”中预填充数据。
这是一个示例,显示了如何使用过期日期的预填充值:
var storedCreditCardInformation = {
// get this info from your server with a payment method lookup
month: '09',
year: '2017'
};
braintree.hostedFields.create({
client: clientInstance,
fields: {
expirationMonth: {
selector: '#expiration-month',
prefill: storedCreditCardInformation.month
},
expirationYear: {
selector: '#expiration-year',
prefill: storedCreditCardInformation.year
}
}
},
callback);
全面披露:我在Braintree工作。如有其他问题,请随时联系Braintree支持[email protected]。
关于javascript - Braintree/Javascript:如何获取交易数据(卡和地址)以预先为客户进行先前的交易?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53037360/