mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Make charges update method update the first pending payment
Updating the first overall payment could select a failed payment and ignore the pending payment that is about to be processed
This commit is contained in:
@@ -432,8 +432,8 @@ Spree::Order.class_eval do
|
||||
# amount here.
|
||||
def charge_shipping_and_payment_fees!
|
||||
update_totals
|
||||
return unless payments.any?
|
||||
return unless pending_payments.any?
|
||||
|
||||
payments.first.update_attribute :amount, total
|
||||
pending_payments.first.update_attribute :amount, total
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user