BraintreeError: Cannot contact the gateway at this time (during system/integration specs only)

BraintreeError: Cannot contact the gateway at this time (during system/integration specs only)

最初来自https://github.com/braintree/braintree-web/issues/296

一般信息

将 braintree-web gem 与 Spree 商店一起使用

SDK版本:3.2.0 环境:测试环境使用rspec 浏览器和 OS:Poltergeist 运行ning phantomjs 问题描述

我们在 Poltergeist 和 Phantom JS 下的规范中遇到此错误 运行。我们正在使用 Phantom JS 2.1.1:

BraintreeError: Cannot contact the gateway at this time

该症状不会出现在我们的生产应用程序中,仅出现在测试我们的应用程序 运行 环境中,运行ning Capubara * Rspec(使用 poltergeis/phantomjs)

对于问题的后代,我们只是想向其他人报告,我们确认其根本原因是 window.braintree.client(...) 函数本身的(无意)双重调用。当我们更正代码时不要重复调用该函数,问题就消失了。如上所述,生产环境中似乎没有出现症状,仅在 phantomjs(capybara/rspec)测试环境中出现。

很好地关闭,因为这是我们自己的重构。

其他答案(不是我们的问题)表明此错误可能是由于 SSL 问题

https://github.com/braintree/braintree-web/issues/249