diff --git a/core/app/models/spree/order_shipping.rb b/core/app/models/spree/order_shipping.rb index 535fa9c2745..96813105000 100644 --- a/core/app/models/spree/order_shipping.rb +++ b/core/app/models/spree/order_shipping.rb @@ -74,7 +74,7 @@ def ship(inventory_units:, stock_location:, address:, shipping_method:, send_shipment_email(carton) if stock_location.fulfillable? && !suppress_mailer # e.g. digital gift cards that aren't actually shipped fulfill_order_stock_locations(stock_location) - update_order_state + @order.update! carton end @@ -85,14 +85,6 @@ def fulfill_order_stock_locations(stock_location) Spree::OrderStockLocation.fulfill_for_order_with_stock_location(@order, stock_location) end - def update_order_state - new_state = Spree::OrderUpdater.new(@order).update_shipment_state - @order.update_columns( - shipment_state: new_state, - updated_at: Time.now, - ) - end - def send_shipment_email(carton) Spree::CartonMailer.shipped_email(carton.id).deliver_later end diff --git a/core/app/models/spree/payment.rb b/core/app/models/spree/payment.rb index 736f14f1e72..ac904f21e93 100644 --- a/core/app/models/spree/payment.rb +++ b/core/app/models/spree/payment.rb @@ -243,18 +243,8 @@ def invalidate_old_payments end def update_order - if completed? || void? - order.updater.update_payment_total - end - - if order.completed? - order.updater.update_payment_state - order.updater.update_shipments - order.updater.update_shipment_state - end - - if self.completed? || order.completed? - order.persist_totals + if order.completed? || completed? || void? + order.update! end end