fixed consume_users_credit call

This commit is contained in:
Bounmy Stephane 2012-05-25 20:44:20 +02:00
parent 84f0c159da
commit 4b1def8643
1 changed files with 5 additions and 1 deletions

View File

@ -149,7 +149,11 @@ module Spree
@order.update_attribute(:state, "complete")
state_callback(:after) # So that after_complete is called, setting session[:order_id] to nil
@order.send(:consume_users_credit) if @order.respond_to?(:consume_users_credit, true)#since we dont rely on state machine callback, we just explicitly call this method for spree_store_credits
# Since we dont rely on state machine callback, we just explicitly call this method for spree_store_credits
if @order.respond_to?(:consume_users_credit, true)
@order.send(:consume_users_credit)
end
@order.finalize!
flash[:notice] = I18n.t(:order_processed_successfully)