Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/adyen/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

module Adyen
class Client
attr_accessor :ws_user, :ws_password, :api_key, :oauth_token, :client, :adapter
attr_accessor :ws_user, :ws_password, :api_key, :oauth_token, :client, :adapter, :logger
attr_reader :env, :connection_options, :adapter_options, :terminal_region

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, adapter_options: nil, terminal_region: nil)
logger: nil, live_url_prefix: nil, mock_service_url_base: nil, connection_options: nil, adapter_options: nil,
terminal_region: nil)
@ws_user = ws_user
@ws_password = ws_password
@api_key = api_key
Expand All @@ -32,6 +33,7 @@ def initialize(ws_user: nil, ws_password: nil, api_key: nil, oauth_token: nil, e
end
@mock_service_url_base = mock_service_url_base || "http://localhost:#{mock_port}"
@live_url_prefix = live_url_prefix
@logger = logger
if RUBY_VERSION >= '3.2'
# set default timeouts
@connection_options = connection_options || Faraday::ConnectionOptions.new(
Expand Down Expand Up @@ -162,6 +164,10 @@ def call_adyen_api(service, action, request_data, headers, version, _with_applic
# add library headers
faraday.headers['adyen-library-name'] = Adyen::NAME
faraday.headers['adyen-library-version'] = Adyen::VERSION

if @logger
faraday.response :logger, @logger
end
end
# if json string convert to hash
# needed to add applicationInfo
Expand Down