Class: SpreeAdyen::Gateways::Configure

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

Instance Method Summary collapse

Constructor Details

#initialize(gateway) ⇒ Configure

Returns a new instance of Configure.



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

def initialize(gateway)
  @gateway = gateway
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
18
# File 'app/services/spree_adyen/gateways/configure.rb', line 8

def call
  gateway.preferred_client_key = configuration.client_key || gateway.generate_client_key.params['clientKey']
  gateway. = configuration.

  set_up_allowed_origins

  set_up_webhook_with_hmac_key unless current_webhook_is_valid?

  gateway.skip_auto_configuration = true
  gateway.save!
end