![](/img/trans.png)
[英]Braintree integration - cannot access javascript nonce in server side code
[英]Braintree Integration - custom form doesn't send nonce
如果我使用文档中的代码并且我没有看到任何提交的 nonce 隐藏输入,则 nonce 不会出现在服务器端。 我只让它与 dropin 一起工作,并且可以在服务器端看到 nonce。
<form id="checkout" action="/checkout" method="post">
<input data-braintree-name="number" value="4111111111111111">
<input data-braintree-name="cvv" value="100">
<input data-braintree-name="expiration_date" value="10/20">
<!-- you can also split expiration date into two fields -->
<input data-braintree-name="expiration_month" value="10">
<input data-braintree-name="expiration_year" value="2020">
<input data-braintree-name="postal_code" value="94107">
<input data-braintree-name="cardholder_name" value="John Smith">
<input type="submit" id="submit" value="Pay">
<script src="https://js.braintreegateway.com/js/braintree-2.24.0.min.js"></script>
<script>
var clientToken = null;
$.get( "/csgosupply/generateToken", function( data ) {
clientToken = data;
braintree.setup(clientToken, "custom", {
container: "checkout"
});
});
我得到了这个人的代码Braintree - 自定义 - 手动提交表单 onPaymentMethodReceived
如果我在短时间内使用与 tokinzeCard 相同的卡号,我会收到“gateway_rejected”。
Braintree 最近在这里发布了新的示例代码,其中包括一个完整的 php 示例。
你应该能够使用它并让它工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.