Prevent auto_capture from making echeck payment paid on checkout complete

This commit is contained in:
Brian Quinn 2010-12-23 13:45:06 +00:00
parent d6620ea283
commit e8b33a7f3c
1 changed files with 14 additions and 1 deletions

View File

@ -19,6 +19,19 @@ class PaypalExpressExtension < Spree::Extension
CheckoutsController.class_eval do
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