Class: SpreeAdyen::Gateways::Configuration

Inherits:
Object
  • Object
show all
Defined in:
app/services/spree_adyen/gateways/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(response_body) ⇒ Configuration

Returns a new instance of Configuration.



4
5
6
# File 'app/services/spree_adyen/gateways/configuration.rb', line 4

def initialize(response_body)
  @response_body = response_body
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/services/spree_adyen/gateways/configuration.rb', line 16

def active?
  response_body['active'].to_s == 'true'
end

#allowed_originsObject



20
21
22
# File 'app/services/spree_adyen/gateways/configuration.rb', line 20

def allowed_origins
  response_body['allowedOrigins'].map { |origin| origin['domain'] }
end

#client_keyObject



8
9
10
# File 'app/services/spree_adyen/gateways/configuration.rb', line 8

def client_key
  response_body['clientKey']
end

#companyObject



32
33
34
# File 'app/services/spree_adyen/gateways/configuration.rb', line 32

def company
  response_body['companyName']
end

#idObject



28
29
30
# File 'app/services/spree_adyen/gateways/configuration.rb', line 28

def id
  response_body['id']
end

#merchant_accountObject



24
25
26
# File 'app/services/spree_adyen/gateways/configuration.rb', line 24

def 
  response_body['associatedMerchantAccounts'].first
end

#rolesObject



12
13
14
# File 'app/services/spree_adyen/gateways/configuration.rb', line 12

def roles
  response_body['roles']
end