From 287eee48a1b5784ee785f506478dcf9bdb4f3b5e Mon Sep 17 00:00:00 2001 From: Bounmy Stephane Date: Tue, 22 May 2012 23:26:11 +0200 Subject: [PATCH] dirty fix store_credit_callback --- app/controllers/spree/checkout_controller_decorator.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb index 0df9919..59d5181 100644 --- a/app/controllers/spree/checkout_controller_decorator.rb +++ b/app/controllers/spree/checkout_controller_decorator.rb @@ -147,6 +147,8 @@ module Spree @order.update_attribute(:state, "complete") state_callback(:after) # So that after_complete is called, setting session[:order_id] to nil + @order.consume_users_credit #since we dont rely on state machine callback, we just explicitly call this method for spree_store_credits + @order.finalize! flash[:notice] = I18n.t(:order_processed_successfully) redirect_to completion_route