Class: ShoppingCart::CheckoutUpdater

Inherits:
Rectify::Command
  • Object
show all
Defined in:
app/services/shopping_cart/checkout_updater.rb

Constant Summary collapse

STEPS =
{
  address: :update_address,
  delivery: :update_delivery,
  payment: :update_credit_card,
  confirm: :confirm_order
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(step:, params:, order:, user:) ⇒ CheckoutUpdater

Returns a new instance of CheckoutUpdater.



10
11
12
13
14
15
# File 'app/services/shopping_cart/checkout_updater.rb', line 10

def initialize(step:, params:, order:, user:)
  @step = step
  @params = params
  @order = order
  @user = user
end

Instance Method Details

#callObject



17
18
19
# File 'app/services/shopping_cart/checkout_updater.rb', line 17

def call
  send(STEPS[@step]) if STEPS[@step]
end