Prevent auto_capture from making echeck payment paid on checkout complete
This commit is contained in:
parent
d6620ea283
commit
e8b33a7f3c
|
@ -20,5 +20,18 @@ class PaypalExpressExtension < Spree::Extension
|
|||
include Spree::PaypalExpress
|
||||
end
|
||||
|
||||
Checkout.class_eval do
|
||||
private
|
||||
def complete_order
|
||||
order.complete!
|
||||
|
||||
# do not transition echeck order to paid regardless of auto-capture
|
||||
# echecks are finalized via IPN callback only
|
||||
if Spree::Config[:auto_capture] && !order.checkout.payments.any? {|p| payment.source.is_a?(PaypalAccount) && p.source.echeck?(p) }
|
||||
order.pay!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue