Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError: undefined method `default_adapter_options' for Faraday:Module #177

Closed
jotolo opened this issue Sep 25, 2023 · 4 comments
Closed

Comments

@jotolo
Copy link

jotolo commented Sep 25, 2023

Describe the bug

Failure/Error:
       Adyen::Client.new(api_key: credentials[:ADYEN_API_KEY],
                         env: credentials[:ADYEN_ENV],
                         live_url_prefix: adyen_live_url)
     
     NoMethodError:
       undefined method `default_adapter_options' for Faraday:Module

How to reproduce
If you try to initialize Adyen::Client class you will get this error

Expected behavior
Being able to initialize the Adyen::Client class

Additional context
It started with version 7.3.0 and it seems to be related to #169
When no adapter_options is specified, it triggers the before mentioned error

@ollym
Copy link
Contributor

ollym commented Sep 25, 2023

@jotolo it was added in Faraday v2.1.0 https://github.com/lostisland/faraday/releases/tag/v2.1.0

What version are you using? (Faraday::VERSION)

@jotolo
Copy link
Author

jotolo commented Sep 26, 2023

Hi @ollym , we are using Faraday 1.10.3. This is why the issue is triggering but there is no constraint on the version needed by the library. Is it needed?

@ollym
Copy link
Contributor

ollym commented Sep 26, 2023

@jotolo yes that should be fixed but suggest you target faraday >= 2.1 in your Gemfile.

Alternatively the following should work with Faraday < 2:

Adyen::Client.new(api_key: credentials[:ADYEN_API_KEY],
                         env: credentials[:ADYEN_ENV],
                         live_url_prefix: adyen_live_url,
                         adapter_options: {})

@jotolo
Copy link
Author

jotolo commented Sep 27, 2023

@ollym Correct. The proposed solution works. I saw #178 was opened and it manages to solve the issue. Once that PR is merged we can close this issue.
Thanks @ollym and @Aleffio for the quick response 🤝 .

@Aleffio Aleffio closed this as completed in 9ffdbcb Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants