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(&:close)
      updater.update_payment_state
      shipments.each do |shipment|
        shipment.update!(self)
        shipment.finalize!
      end
      updater.update_shipment_state
      save!
      updater.run_hooks
      touch :completed_at
      deliver_order_confirmation_email unless confirmation_delivered?
      consider_risk
    end
def finalize! all_adjustments . each ( & :close ) updater . update_payment_state shipments . each do | shipment | shipment . update! ( self ) shipment . finalize! end updater . update_shipment_state save! updater . run_hooks touch :completed_at deliver_order_confirmation_email unless confirmation_delivered? consider_risk 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