![](/img/trans.png)
[英]Braintree-javascript - How to charge users monthly based on usage?
[英]Braintree-javascript - collect additional customer information?
問題是:收集客戶信息並將其存儲在Vault中的正確方法是什么?
我想在填寫並提交用戶界面表單后將客戶的帳單信息存儲在Braintree的保管庫中,以創建定期的未來交易。 未來的交易將收取不規則/可變金額。
目前,我已配置的嵌入式ui僅具有一個Paypal按鈕,並且輸入了cc#和到期日期的字段。 這是我目前在嵌入式ui中的功能:
根據文檔 ,Braintree插入式ui僅允許收集:cc#,exp日期,郵政編碼/ cvv,paypal acc和venmo acc。
我一直在考慮創建表單並使用jquery從輸入字段收集並將其提供給Braintree的transaction API的思路,但是不確定這是否符合PCI / SAQ-A。 我還發現, 成功交易后 ,我可以在金庫中存儲新客戶 。
代碼如下:
<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>
任何幫助深表感謝! 感謝您抽出寶貴的時間閱讀。
全面披露:我在Braintree工作。 如果您還有其他疑問,請隨時與支持小組聯系 。
Braintree Drop-in UI負責收集PCI和其他敏感的付款信息。 您提到的方法是收集表單中的帳單信息,然后通過API從服務器(使用transaction.sale或paymentMethod.create )將帳單信息提交給Braintree,這是填充此信息的正確方法。 這種方法完全符合PCI。
此外,在您的示例中, braintree.setup
將form
屬性傳遞給braintree.setup
,因為您的payment-form
div位於checkout
表單內。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.