I was just wondering if you had any advice around using the Braintree JS lib in acceptance tests. I'd like our whole payment flow to be in an acceptance test, but when in the JS we do braintree.client.create it's calling the callback with the error: "BraintreeError: Cannot contact the gateway at this time.". We're using Rails/Minitest/Capybara.
What browser drivers are you using with Capybara?
I ask because if you're using IE 9 or 10, they do not have the correct TLS settings on by default. See here for more details: https://developers.braintreepayments.com/reference/client-reference/javascript/v2/browser-support#older-tls-versions
We're using poltergeist, so headless WebKit.
Thanks for the TLS tipoff - I looked into it and there are lots of issues with poltergeist/phantomjs around TLS settings - and I found that passing this option to phantomjs fixed the issue for me: --ssl-protocol=tlsv1.2
:+1:
I was getting the same error using Rails/Rspec/Capybara.
Passing --ssl-protocol=any to phantomjs options also fixed the issue. Thanks!
Most helpful comment
We're using poltergeist, so headless WebKit.
Thanks for the TLS tipoff - I looked into it and there are lots of issues with poltergeist/phantomjs around TLS settings - and I found that passing this option to phantomjs fixed the issue for me:
--ssl-protocol=tlsv1.2