Braintree IOS + rails 错误 91564 不能多次使用 payment_method_nonce

Braintree IOS + rails error 91564 Cannot use a payment_method_nonce more than once

我在 Braintree::Transaction.sale

上收到来自 Braintree 的错误消息
Braintree::ErrorResult params:{...} errors:transaction:[(91564)
  Cannot use a payment_method_nonce more than once.

然而,当我检查随机数令牌时,它总是与上次请求不同。

从 IOS 应用收到的样本随机数:

10e368f1-81bc-4ace-b4b4-76cfdc4d1459
02cc81b2-d6c7-416b-b5d5-5b23c7e81fad

问题已解决。我试图通过 paymentMethod.create 使用随机数手动添加卡片...我在 Transaction.Sale 中使用的相同随机数而不是使用 Transaction.Sale 返回的令牌=14=].

在我的例子中,我必须添加

$('#js-payment-form').on('submit', function(e) {
  e.preventDefault();
});

使下面的配置工作

braintree.setup("clienttoken", "custom", {
    id: 'js-payment-form',
    paypal: {
        container: "paypal-button",
        displayName: "Test"
    }
});