Module: SpreeCmCommissioner::Api::V2::Storefront::CartControllerDecorator

Defined in:
app/controllers/spree_cm_commissioner/api/v2/storefront/cart_controller_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



6
7
8
# File 'app/controllers/spree_cm_commissioner/api/v2/storefront/cart_controller_decorator.rb', line 6

def self.prepended(base)
  base.include SpreeCmCommissioner::OrderConcern
end

Instance Method Details

#restart_checkout_flowObject

Restart the checkout flow to bring the order back to the cart view



11
12
13
14
15
16
17
18
# File 'app/controllers/spree_cm_commissioner/api/v2/storefront/cart_controller_decorator.rb', line 11

def restart_checkout_flow
  spree_authorize! :update, spree_current_order, order_token

  spree_current_order.restart_checkout_flow
  spree_current_order.update_with_updater!

  render_serialized_payload { serialized_current_order }
end