Class: SpreeAdyen::Gateways::Configuration
- Inherits:
-
Object
- Object
- SpreeAdyen::Gateways::Configuration
- Defined in:
- app/services/spree_adyen/gateways/configuration.rb
Instance Method Summary collapse
- #active? ⇒ Boolean
- #allowed_origins ⇒ Object
- #client_key ⇒ Object
- #company ⇒ Object
- #id ⇒ Object
-
#initialize(response_body) ⇒ Configuration
constructor
A new instance of Configuration.
- #merchant_account ⇒ Object
- #roles ⇒ Object
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
16 17 18 |
# File 'app/services/spree_adyen/gateways/configuration.rb', line 16 def active? response_body['active'].to_s == 'true' end |
#allowed_origins ⇒ Object
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_key ⇒ Object
8 9 10 |
# File 'app/services/spree_adyen/gateways/configuration.rb', line 8 def client_key response_body['clientKey'] end |
#company ⇒ Object
32 33 34 |
# File 'app/services/spree_adyen/gateways/configuration.rb', line 32 def company response_body['companyName'] end |
#id ⇒ Object
28 29 30 |
# File 'app/services/spree_adyen/gateways/configuration.rb', line 28 def id response_body['id'] end |
#merchant_account ⇒ Object
24 25 26 |
# File 'app/services/spree_adyen/gateways/configuration.rb', line 24 def merchant_account response_body['associatedMerchantAccounts'].first end |
#roles ⇒ Object
12 13 14 |
# File 'app/services/spree_adyen/gateways/configuration.rb', line 12 def roles response_body['roles'] end |