2015-12-04 86 views
1

問題是:收集客戶信息並將其存儲在保險庫中的正確方法是什麼?Braintree-javascript - 收集更多客戶信息?

我希望在填寫和提交嵌入式UI表單時將客戶的結算信息存儲在Braintree的保管庫中,以便創建定期的未來交易。未來的交易將會收取不定額/不同的金額。

目前,我已經配置的嵌入式用戶界面只有一個貝寶按鈕和輸入字段的cc#和到期日期。這是我目前有插入式用戶界面:

Drop-in ui I have configured

按照docs,布倫特裏插入式用戶界面只允許收集:CC#,進出口日期,郵政編碼/ CVV,貝寶acc和venmo acc。

我一直在思考創建表單和使用jquery從輸入字段收集並將其提供給Braintree的transaction API,但不確定這是符合PCI/SAQ-A的。我也發現我可以store a new customer in the vault upon a successful transaction

Work in progress form

代碼如下所示:

<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> 

任何幫助,非常感謝!感謝您花時間閱讀。

回答

2

完全披露:我在布倫特裏工作。如果您有任何其他問題,請隨時致電contact support

Braintree Drop-in UI負責收集PCI和其他敏感付款信息。您提到的方法是,在表單中收集帳單信息,然後通過服務器的API(使用transaction.salepaymentMethod.create)通過API將結算信息提交給Braintree,這是填充此信息的正確方法。這種方法完全符合PCI標準。

此外,經過form屬性braintree.setup因爲你payment-form DIV是你checkout表單中是不是在你的榜樣必要的。

+0

非常感謝! – c0de