如果我使用文档中的代码并且我没有看到任何提交的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 - Custom - Manual form submission onPaymentMethodReceived
我得到&#34; gateway_rejected&#34;如果我在短时间内使用与tokinzeCard相同的卡号。