简体   繁体   English

BrainTreePayments创建新的付款方式

[英]BrainTreePayments create new payment method

I am going through the BrainTreePayments documentation page and I came across the Payment Methods. 我正在浏览BrainTreePayments文档页面,并且遇到了“付款方式”。 The documentation says "To create a new payment method for an existing customer, the only required attributes are the customer ID and payment method nonce." 该文档说:“要为现有客户创建新的付款方式,唯一需要的属性是客户ID和付款方式随机数。”

gateway.paymentMethod.create({
  customerId: "12345",
  paymentMethodNonce: nonceFromTheClient
}, function (err, result) { });

The question is 问题是

1) How do we create a new payment method for a new customer without payment method nonce? 1)我们如何为没有付款方式随机数的新客户创建新的付款方式? 2) How do we verify the validity of an existing payment method? 2)我们如何验证现有付款方式的有效性?

Full disclosure: I work at Braintree. 全面披露:我在Braintree工作。 If you have any further questions, feel free to contact support . 如果您还有其他疑问,请随时与支持小组联系。

1) A payment method is like a container to store payment information in your Vault, whereas the payment method nonce is a way to deliver payment information to Braintree. 1)付款方式就像一个容器,用于在您的保险柜中存储付款信息,而付款方式随机数是一种付款信息传递给Braintree的方式。 You use a payment method nonce to deliver payment information to create payment methods, transactions, etc. A payment method can be referenced to generate a payment method nonce from stored payment information, but the payment method must store something. 您可以使用付款方式随机数来传递付款信息以创建付款方式,交易等。可以参考付款方式以根据存储的付款信息生成付款方式随机数,但是该付款方式必须存储一些内容。 You can't create an empty payment method. 您无法创建空付款方式。

2) To verify an existing payment method, use 'PaymentMethod.update()' and include 'verify_card' in your options. 2)要验证现有的付款方式,请使用“ PaymentMethod.update()”并在您的选项中包含“ verify_card”。 If you have enabled fraud tools in your control panel, newly created payment methods for credit cards will be verified before they are stored in the Vault. 如果您在控制台中启用了欺诈工具 ,则新验证的信用卡付款方式将在存储在保险柜中之前经过验证。 Cards that are not valid will not be stored and you will receive an error response . 无效的卡将不会被存储,并且您将收到错误响应

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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