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:
luisramos0
2020-02-07 15:47:25 +00:00
committed by Luis Ramos
parent 19042e0d37
commit c0bf09131f

View File

@@ -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)