简体   繁体   English

使用 Braintree 的 Javascript SDK 设置客户付款选项?

[英]Setting up customer payment options with Braintree's Javascript SDK?

I'm attempting to go through Braintree's javascript SDK documentation, but it's a bit sparse.我正在尝试浏览Braintree 的 javascript SDK文档,但它有点稀疏。

What is the minimum html I have to write in order to enable a customer to setup a credit card to use with braintree payments?为了使客户能够设置信用卡以用于 Braintree 支付,我必须编写的最低 html 是多少? How does the braintree javascript sdk then process the html or does it setup the html itself and also process it? Braintree javascript sdk 然后如何处理 html 或它是否设置 html 本身并处理它?

Does the braintree javascript SDK first have to grab some values from the server before it can setup the customer and does it have to have certain values hardcoded before it can grab those values?在设置客户之前,braintree javascript SDK 是否首先必须从服务器获取一些值,并且在获取这些值之前是否必须对某些值进行硬编码?

I know I have to setup the server side of this, but I'm just trying to figure out the client side javascript first.我知道我必须设置它的服务器端,但我只是想先弄清楚客户端的 javascript。

Full disclosure: I work at Braintree.完全披露:我在布伦特里工作。 If you have any further questions, feel free to contact support .如果您有任何其他问题,请随时联系支持

I'd be happy to help!我很乐意帮忙!

What is the minimum html I have to write in order to enable a customer to setup a credit card to use with braintree payments?为了使客户能够设置信用卡以用于 Braintree 支付,我必须编写的最低 html 是多少?

The minimum amount of HTML you'd have to write to collect/store/transact customer payment information would be by using Braintree's Drop-in integration.您必须使用 Braintree 的 Drop-in 集成来收集/存储/处理客户付款信息,而必须编写的最少 HTML 量。 You can check out this link for a basic Drop-in example.您可以查看此链接以获取基本的 Drop-in 示例。

How does the braintree javascript sdk then process the html or does it setup the html itself and also process it? Braintree javascript sdk 然后如何处理 html 或它是否设置 html 本身并处理它?

The SDK will instantiate a DropIn within a specified HTML container. SDK 将在指定的 HTML 容器中实例化 DropIn。 Before the form is submitted the javascript will attempt to tokenize the inputted data with Braintree, in which a nonce will be returned to your client.在提交表单之前,javascript 将尝试使用 Braintree 标记输入的数据,其中将向您的客户端返回一个随机数。

Does the braintree javascript SDK first have to grab some values from the server before it can setup the customer and does it have to have certain values hardcoded before it can grab those values?在设置客户之前,braintree javascript SDK 是否首先必须从服务器获取一些值,并且在获取这些值之前是否必须对某些值进行硬编码?

The JS SDK will grab the values provided to the Drop-in and send them to Braintree. JS SDK 将获取提供给 Drop-in 的值并将它们发送到 Braintree。 Braintree will tokenize those values and return a nonce to your client as part of the payload. Braintree 会将这些值标记化,并将随机数作为有效负载的一部分返回给您的客户端。 That nonce should be sent back to your server, in which it can be consumed as part of a Customer.create() , Transaction.sale() , or PaymentMethod.create() API call.该随机数应发送回您的服务器,在其中它可以作为Customer.create()Transaction.sale()PaymentMethod.create() API 调用的一部分使用。

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

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