Class: ShoppingCart::CheckoutController

Inherits:
ApplicationController show all
Includes:
Wicked::Wizard
Defined in:
app/controllers/shopping_cart/checkout_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



11
12
13
14
15
16
17
# File 'app/controllers/shopping_cart/checkout_controller.rb', line 11

def show
  @checkout_data = GetCheckoutData.call(@order, step)
  ValidateStep.call(@step, @order) do
    on(:ok)       { render_wizard }
    on(:invalid)  { redirect_to previous_wizard_path }
  end
end

#updateObject



19
20
21
22
23
24
25
# File 'app/controllers/shopping_cart/checkout_controller.rb', line 19

def update
  ProceedCheckout.call(params, @order, step) do
    on(:ok)         { render_wizard @order }
    on(:invalid)    { redirect_to root_path }
    on(:validation) { render_wizard }
  end
end