Make update_pending_payment private

It's not used anywhere in the code, there is no reason for it to be
public
This commit is contained in:
Gaetan Craig-Riou
2024-02-06 16:49:08 +11:00
parent 75355b0359
commit e6fba74a87

View File

@@ -38,13 +38,6 @@ module OrderManagement
update_pending_payment
end
def update_pending_payment
return unless order.state.in? ["payment", "confirmation"]
return unless order.pending_payments.any?
order.pending_payments.first.update_attribute :amount, order.total
end
# Updates the following Order total values:
#
# - payment_total - total value of all finalized Payments (excludes non-finalized Payments)
@@ -239,6 +232,13 @@ module OrderManagement
def requires_authorization?
payments.requires_authorization.any? && payments.completed.empty?
end
def update_pending_payment
return unless order.state.in? ["payment", "confirmation"]
return unless order.pending_payments.any?
order.pending_payments.first.update_attribute :amount, order.total
end
end
end
end