Ruby on rails Braintree客户端令牌验证错误

Ruby on rails Braintree客户端令牌验证错误,ruby-on-rails,braintree,Ruby On Rails,Braintree,我正在使用带有angularjs(前端)和rails(后端)的braintree Drop-in UI。我正在创建clientToken并将其发送到braintree安装程序 客户端令牌方法 @client_token = Braintree::ClientToken.generate(customer_id: current_user.braintree_customer_id,options: { verify_card: true, fail

我正在使用带有angularjs(前端)和rails(后端)的braintree Drop-in UI。我正在创建clientToken并将其发送到braintree安装程序

客户端令牌方法

@client_token = Braintree::ClientToken.generate(customer_id: current_user.braintree_customer_id,options: {
            verify_card: true,
            fail_on_duplicate_payment_method: true
            })
如你所见,我选择了“重复支付失败”选项。并尝试再次添加相同的付款方式

然后,通过验证,我在dropin上得到一个错误,说“处理您的请求时出错”,但它不会出现在错误回调中。

这是设置,很好

 braintree.setup(vm.clientToken, 'dropin', {
    container: 'dropin-container',
    onPaymentMethodReceived: function(data) 
    { 
      alert('came recieved')
      // console.log($scope.paymentForm)
      vm.submit($scope.paymentForm, data.nonce)
    },
    onReady: function ()  {
        vm.disablePay = false;
    },
    onError: function(type, message)  {
        alert('came error')
        vm.serverError = message;
    }
});
这是错误的图像

网络中的错误是

callback_jsona7f3c885267b4f49aa13fbf01cecdb60({"error":{"message":"Credit card is invalid"},<br>"fieldErrors":[{"field":"creditCard","fieldErrors":[{"field":"number","code":"81724","message":"Duplicate card exists in the vault"}]}],"status":422})
callback_jsona7f3c885267b4f49aa13ff01cecdb60({“错误”:{“消息”:“信用卡无效”},
“字段错误”:[{“字段”:“信用卡”,“字段错误”:[{“字段”:“编号”,“代码”:“81724”,“消息”:“保险库中存在重复的卡”}],“状态”:422})
我想把这个错误带入我的视野。我搜索了很多链接,但没有得到我需要的答案。任何帮助都是值得的。
提前谢谢。

完全披露:我是Braintree的开发者

onError
回调仅由客户端错误触发,这实际上是服务器端错误;但是,团队意识到了这一需求,并正在开发一个解决方案,该解决方案将在未来的版本中提供