mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-22 05:18:51 +00:00
Extract order-updating logic to Order::Updater
This commit is contained in:
@@ -201,19 +201,7 @@ module Spree
|
||||
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.updater.persist_totals
|
||||
end
|
||||
OrderManagement::Order::Updater.new(order).after_payment_update(self)
|
||||
end
|
||||
|
||||
# Necessary because some payment gateways will refuse payments with
|
||||
|
||||
Reference in New Issue
Block a user