Skip to content

Commit

Permalink
Add adapter_options to client (#169)
Browse files Browse the repository at this point in the history
* Add adapter_options to client

* typo

---------

Co-authored-by: jillingk <93914435+jillingk@users.noreply.github.com>
  • Loading branch information
ollym and jillingk committed Sep 25, 2023
1 parent 6b20dc0 commit ccee71f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/adyen/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
module Adyen
class Client
attr_accessor :ws_user, :ws_password, :api_key, :oauth_token, :client, :adapter
attr_reader :env, :connection_options
attr_reader :env, :connection_options, :adapter_options

def initialize(ws_user: nil, ws_password: nil, api_key: nil, oauth_token: nil, env: :live, adapter: nil, mock_port: 3001,
live_url_prefix: nil, mock_service_url_base: nil, connection_options: nil)
live_url_prefix: nil, mock_service_url_base: nil, connection_options: nil, adapter_options: nil)
@ws_user = ws_user
@ws_password = ws_password
@api_key = api_key
@oauth_token = oauth_token
@env = env
@adapter = adapter || Faraday.default_adapter
@adapter_options = adapter_options || Faraday.default_adapter_options
@mock_service_url_base = mock_service_url_base || "http://localhost:#{mock_port}"
@live_url_prefix = live_url_prefix
@connection_options = connection_options || Faraday::ConnectionOptions.new
Expand Down Expand Up @@ -118,7 +119,7 @@ def call_adyen_api(service, action, request_data, headers, version, _with_applic

# initialize Faraday connection object
conn = Faraday.new(url, @connection_options) do |faraday|
faraday.adapter @adapter
faraday.adapter @adapter, **@adapter_options
faraday.headers['Content-Type'] = 'application/json'
faraday.headers['User-Agent'] = "#{Adyen::NAME}/#{Adyen::VERSION}"

Expand Down

0 comments on commit ccee71f

Please sign in to comment.