Sha256: cf84efa888d8a7418f7d9314202e1b188a067d0b403cc75b56df70dc8a77b6b0

Contents?: true

Size: 596 Bytes

Versions: 12

Compression:

Stored size: 596 Bytes

Contents

Spree::Order.class_eval do
  # Make sure the order confirmation is delivered when the order has been paid for.
  def finalize!
    # lock all adjustments (coupon promotions, etc.)
    all_adjustments.each(&:close)

    # update payment and shipment(s) states, and save
    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? or !paid?

    consider_risk
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
spree_mollie_gateway-2.1.1.pre.beta app/models/spree/order_decorator.rb
spree_mollie_gateway-2.1.0 app/models/spree/order_decorator.rb
spree_mollie_gateway-2.0.0 app/models/spree/order_decorator.rb
spree_mollie_gateway-1.0.7 app/models/spree/order_decorator.rb
spree_mollie_gateway-1.0.6 app/models/spree/order_decorator.rb
spree_mollie_gateway-1.0.5 app/models/spree/order_decorator.rb
spree_mollie_gateway-1.0.4 app/models/spree/order_decorator.rb
spree_mollie_gateway-1.0.3 app/models/spree/order_decorator.rb
spree_mollie_gateway-1.0.2 app/models/spree/order_decorator.rb
spree_mollie_gateway-1.0.0 app/models/spree/order_decorator.rb
spree_mollie_gateway-1.0.0.pre.beta4 app/models/spree/order_decorator.rb
spree_mollie_gateway-1.0.0.pre.beta3 app/models/spree/order_decorator.rb