core/app/models/spree/order.rb
# Finalizes an in progress order after checkout is complete.
# Called after transition to complete state when payments will have been processed
Finalizes an in progress order after checkout is complete.
Called after transition to complete state when payments will have been processed
Finalizes an in progress order after checkout is complete . Called after transition to complete state when payments will have been processed
def finalize!
      all_adjustments.each(&:finalize!)
      updater.update_payment_state
      shipments.each do |shipment|
        shipment.update_state
        shipment.finalize!
      end
      updater.update_shipment_state
      save!
      updater.run_hooks if update_hooks.any?
      touch :completed_at
      Spree::Event.fire 'order_finalized', order: self
      if method(:deliver_order_confirmation_email).owner != self.class
        Spree::Deprecation.warn \
          "deliver_order_confirmation_email has been deprecated and moved to " \
          "Spree::MailerSubscriber#order_finalized, please move there any customizations.",
          caller(1)
      end
    end
def finalize! all_adjustments . each ( & :finalize! ) updater . update_payment_state shipments . each do | shipment | shipment . update_state shipment . finalize! end updater . update_shipment_state save! updater . run_hooks if update_hooks . any? touch :completed_at Spree :: Event . fire 'order_finalized' , order : self if method ( :deliver_order_confirmation_email ) . owner != self . class Spree :: Deprecation . warn "deliver_order_confirmation_email has been deprecated and moved to " "Spree::MailerSubscriber#order_finalized, please move there any customizations." , caller ( 1 ) end end
Finalizes an in progress order after checkout is complete.
Finalizes an in progress order after checkout is complete .
# lock all adjustments (coupon promotions, etc.) # update payment and shipment(s) states, and save