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


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

def cse_public_key
  @cse_public_key
end

#default_currencyObject

Returns the value of attribute default_currency


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

def default_currency
  @default_currency
end

#default_merchant_accountObject

Returns the value of attribute default_merchant_account


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

def 
  @default_merchant_account
end

#environmentObject

Returns the value of attribute environment


3
4
5
# File 'lib/adyen_client/configuration.rb', line 3

def environment
  @environment
end

#passwordObject

Returns the value of attribute password


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

def password
  @password
end

#usernameObject

Returns the value of attribute username


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

def username
  @username
end

Instance Method Details

#apply(klass) ⇒ Object


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

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


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

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