Class: AdyenClient::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/adyen_client/configuration.rb

Constant Summary collapse

BASE_URI =
"https://pal-%s.adyen.com/pal/servlet"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cse_public_keyObject

Returns the value of attribute cse_public_key.



8
9
10
# File 'lib/adyen_client/configuration.rb', line 8

def cse_public_key
  @cse_public_key
end

#default_currencyObject

Returns the value of attribute default_currency.



10
11
12
# File 'lib/adyen_client/configuration.rb', line 10

def default_currency
  @default_currency
end

#default_merchant_accountObject

Returns the value of attribute default_merchant_account.



9
10
11
# File 'lib/adyen_client/configuration.rb', line 9

def 
  
end

#environmentObject

Returns the value of attribute environment.



5
6
7
# File 'lib/adyen_client/configuration.rb', line 5

def environment
  @environment
end

#passwordObject

Returns the value of attribute password.



7
8
9
# File 'lib/adyen_client/configuration.rb', line 7

def password
  @password
end

#usernameObject

Returns the value of attribute username.



6
7
8
# File 'lib/adyen_client/configuration.rb', line 6

def username
  @username
end

Instance Method Details

#apply(klass) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/adyen_client/configuration.rb', line 16

def apply(klass)
  klass.base_uri(BASE_URI % environment)
  klass.basic_auth(username, password)
  # prevent following redirects and raise HTTParty::RedirectionTooDeep
  klass.no_follow(true)
  klass.format(:json)
  klass.headers("Content-Type" => "application/json; charset=utf-8")
end

#set(hash) ⇒ Object



12
13
14
# File 'lib/adyen_client/configuration.rb', line 12

def set(hash)
  hash.each { |k, v| send("#{k}=", v) if respond_to?("#{k}=") }
end