Sha256: 0d27a5534738f3d76e2be4ea2da5d13977ad35e63193008e6ca41106cc2c46f9

Contents?: true

Size: 774 Bytes

Versions: 4

Compression:

Stored size: 774 Bytes

Contents

Spree::CheckoutController.class_eval do

  #TODO 90% of this method is duplicated code. DRY
  def update
    if @order.update_attributes(object_params)

      fire_event('spree.checkout.update')
      render :edit and return unless apply_coupon_code

      if @order.next
        state_callback(:after)
      else
        flash[:error] = t(:payment_processing_failed)
        redirect_to checkout_state_path(@order.state)
        return
      end

      if @order.state == 'complete' || @order.completed?
        flash.notice = t(:order_processed_successfully)
        flash[:commerce_tracking] = 'nothing special'
        redirect_to completion_route
      else
        redirect_to checkout_state_path(@order.state)
      end
    else
      render :edit
    end
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
spree_promo-1.3.0 app/controllers/spree/checkout_controller_decorator.rb
spree_promo-1.3.0.rc2 app/controllers/spree/checkout_controller_decorator.rb
dup_spree_promo-1.3.0.rc1 app/controllers/spree/checkout_controller_decorator.rb
spree_promo-1.3.0.rc1 app/controllers/spree/checkout_controller_decorator.rb