mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Make order.pending_payments include payments in pending state so that these payments (pending is the state after authorization for credit cards) are also processed as part of the normal order workflow
This commit is contained in:
@@ -115,6 +115,12 @@ Spree::Order.class_eval do
|
||||
end
|
||||
end
|
||||
|
||||
# "Checkout" is the initial state and, for card payments, "pending" is the state after authorization
|
||||
# These are both valid states to process the payment
|
||||
def pending_payments
|
||||
(payments.select(&:pending?) + payments.select(&:checkout?)).uniq
|
||||
end
|
||||
|
||||
def remove_variant(variant)
|
||||
line_items(:reload)
|
||||
current_item = find_line_item_by_variant(variant)
|
||||
|
||||
Reference in New Issue
Block a user