Class: Spree::CheckoutController

Inherits:
StoreController show all
Defined in:
app/controllers/spree/checkout_controller.rb

Overview

This is somewhat contrary to standard REST convention since there is not actually a Checkout object. There’s enough distinct logic specific to checkout which has nothing to do with updating an order that this approach is warranted.

Instance Method Summary collapse

Methods inherited from StoreController

#cart_link, #unauthorized

Instance Method Details

#updateObject

Updates the order and advances to the next state (when possible.)



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'app/controllers/spree/checkout_controller.rb', line 29

def update
  if update_order

    assign_temp_address

    unless transition_forward
      redirect_on_failure
      return
    end

    if @order.completed?
      finalize_order
    else
      send_to_next_state
    end

  else
    render :edit
  end
end