我正在将Braintree集成到现有站点中,并使它运作良好,从而成功地向沙盒销售。但是,当我尝试添加getId()
字段时,它不会出现在表单中。我的代码看起来像这样。
carderholderName
谁能看到为什么<div id="braintree-payment-form"></div>
<script>
braintree.setup(clientToken, "dropin", {
container: 'braintree-payment-form',
amount: 10.00,
vaultManager: true,
card: {
cardholderName: {
required: true
}
},
paypal: {
button: {
type: 'checkout'
}
},
currency: 'AUD',
enableBillingAddress: true,
onUnsupported: '/braintree/notSupportedByBrowserCallbackURL',
onCancelled: '/braintree/onCancelCallbackURL',
onSuccess: '/braintree/onSuccessfulURL',
billingAgreementDescription: 'Agreement to agree by client on PayPal description',
onError: function (obj) {
if (obj.type === 'VALIDATION') {
// Validation errors contain an array of error field objects:
console.log(obj.details.invalidFields);
} else if (obj.type === 'SERVER') {
// If the customer's browser can't connect to Braintree:
console.log(obj.message); // "Connection error"
// If the credit card failed verification:
console.log(obj.message); // "Credit card is invalid"
console.log(obj.details); // Object with error-specific information
}
}
});
</script>
字段不会出现在表单中?