[英]Braintree-javascript - collect additional customer information?
Question is:What is the correct way for collecting customer information and storing it in the vault? 问题是:收集客户信息并将其存储在Vault中的正确方法是什么?
I want to store customer's billing information in Braintree's vault upon filling out and submitting the drop-in ui form for the purpose of creating periodic future transactions. 我想在填写并提交用户界面表单后将客户的帐单信息存储在Braintree的保管库中,以创建定期的未来交易。 Future transactions will have irregular/varied amounts being charged.
未来的交易将收取不规则/可变金额。
Currently the drop-in ui I have configured only has a paypal button and input fields for cc # and expiration date. 目前,我已配置的嵌入式ui仅具有一个Paypal按钮,并且输入了cc#和到期日期的字段。 This is what I currently have for drop-in ui:
这是我目前在嵌入式ui中的功能:
According to the docs , Braintree drop-in ui only allows collecting: cc#, exp date, postal code/cvv, paypal acc, and venmo acc. 根据文档 ,Braintree插入式ui仅允许收集:cc#,exp日期,邮政编码/ cvv,paypal acc和venmo acc。
I was thinking something along the lines of creating a form and collecting from input fields using jquery and feeding it to Braintree's transaction API , but not sure this is PCI/SAQ-A compliant. 我一直在考虑创建表单并使用jquery从输入字段收集并将其提供给Braintree的transaction API的思路,但是不确定这是否符合PCI / SAQ-A。 I also found that I can store a new customer in the vault upon a successful transaction .
我还发现, 成功交易后 ,我可以在金库中存储新客户 。
Code looks like this: 代码如下:
<div class="container-fluid">
<div class="container">
<form class="form-horizontal" role="form" id="checkout" method="post" action="/checkout">
<!-- billing information -->
<div class="container" style="width: 50%">
<div class="form-group">
<label class="control-label col-xs-3" for="Full Name">Full Name:</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="fullname" placeholder="Full Name">
</div>
<br>
<label class="control-label col-xs-3" for="Address">Address:</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="Address" placeholder="Address">
</div>
<br>
zip | city
<br>
country
</div>
</div>
<hr>
<!-- braintree drop-in ui form-->
<div class="text-center" id="payment-form"></div>
<!-- TOS -->
<div class="container">
<h4>TOS Place holder</h4>
This will be where the TOS goes. It's a pretty good space is it not?
<br>
<h4>TOS Place holder</h4>
This will be where the TOS goes. It's a pretty good space is it not?
<br>
<h4>TOS Place holder</h4>
This will be where the TOS goes. It's a pretty good space is it not?
</div>
<hr>
<div class="text-center">
<input type="submit" value="Submit Payment" class="btn btn-primary btn-lg">
</div>
</form>
</div>
</div>
<!-- braintree sdk -->
<script src="https://js.braintreegateway.com/v2/braintree.js"></script>
<!-- braintree setup -->
<script>
/*
* Uncomment when no longer in sandbox
*/
//Get client token
// $.get( "/client_token", function(clientToken) {
// braintree.setup(clientToken, 'dropin', {
// container: 'payment-form'
// });
// });
var clientToken = *removed*;
braintree.setup(
// Replace this with a client token from your server
clientToken,
"dropin", {
container: "payment-form",
form: "checkout",
});
</script>
Any help is much appreciated! 任何帮助深表感谢! Thank you for taking the time to read.
感谢您抽出宝贵的时间阅读。
Full disclosure: I work at Braintree. 全面披露:我在Braintree工作。 If you have any further questions, feel free to contact support .
如果您还有其他疑问,请随时与支持小组联系 。
The Braintree Drop-in UI is responsible for collecting PCI and other sensitive payment information. Braintree Drop-in UI负责收集PCI和其他敏感的付款信息。 The approach you mentioned, collecting billing information in a form and then submitting the billing information to Braintree via API from your server (using transaction.sale or paymentMethod.create ), is the correct approach for populating this information.
您提到的方法是收集表单中的帐单信息,然后通过API从服务器(使用transaction.sale或paymentMethod.create )将帐单信息提交给Braintree,这是填充此信息的正确方法。 This approach is fully PCI compliant.
这种方法完全符合PCI。
Additionally, passing the form
attribute to braintree.setup
is not necessary in your example because your payment-form
div is within your checkout
form. 此外,在您的示例中,
braintree.setup
将form
属性传递给braintree.setup
,因为您的payment-form
div位于checkout
表单内。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.