Class: Spree::Checkout::Update

Inherits:
Object
  • Object
show all
Includes:
ServiceModule::Base
Defined in:
app/services/spree/checkout/update.rb

Instance Method Summary collapse

Methods included from ServiceModule::Base

prepended

Instance Method Details

#call(order:, params:, permitted_attributes:, request_env:) ⇒ Object



6
7
8
9
10
11
12
# File 'app/services/spree/checkout/update.rb', line 6

def call(order:, params:, permitted_attributes:, request_env:)
  params = replace_country_iso_with_id(params, 'ship') if address_with_country_iso_present?(params, 'ship')
  params = replace_country_iso_with_id(params, 'bill') if address_with_country_iso_present?(params, 'bill')
  return success(order) if order.update_from_params(params, permitted_attributes, request_env)

  failure(order)
end