Jason FB
Jason FB

Reputation: 5940

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

originally from https://github.com/braintree/braintree-web/issues/296

General information

Using braintree-web gem with Spree store

SDK version: 3.2.0 Environment: test environment using rspec Browser and OS: Poltergeist running phantomjs Issue description

We get this error running our specs under Poltergeist and Phantom JS. We are using Phantom JS 2.1.1:

BraintreeError: Cannot contact the gateway at this time

The symptom does not appear for our Production app, only for the test run environment testing our app, running Capubara * Rspec (using poltergeis/phantomjs)

Upvotes: 1

Views: 1754

Answers (3)

Barry
Barry

Reputation: 754

This error will also be reported if requests to relevant third-party domains such as braintree-api.com or pay.google.com are being blocked by, for example, a browser privacy addon.

In my case, it was a browser addon that I had not yet disabled for my local development site which caused a few minutes of head scratching.

Upvotes: 0

Jason FB
Jason FB

Reputation: 5940

for the posterity of the issue, just waned to report back for others that we confirmed the root cause of this was an (unintentional) double-invocations of window.braintree.client(...) functional itself.. When we corrected our code not to double invoke that function, the problem went away. As explained above, symptom did not seem to manifest in Production, only in the phantomjs (with capybara/rspec) test environment.

Good to close as this was from our own refactor.

Upvotes: 2

Jason FB
Jason FB

Reputation: 5940

other answers (was not our issue) indicate this error might show up for an SSL problem

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

Upvotes: 1

Related Questions