diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index f2ac9ee02e..0896defdc3 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -49,6 +49,7 @@ module Spree scope :pending, -> { with_state('pending') } scope :failed, -> { with_state('failed') } scope :valid, -> { where('state NOT IN (?)', %w(failed invalid)) } + scope :authorization_action_required, -> { where.not(cvv_response_message: nil) } # order state machine (see http://github.com/pluginaweek/state_machine/tree/master for details) state_machine initial: :checkout do diff --git a/app/queries/payments_requiring_action.rb b/app/queries/payments_requiring_action.rb index e350a501a1..f9b8c16f69 100644 --- a/app/queries/payments_requiring_action.rb +++ b/app/queries/payments_requiring_action.rb @@ -6,8 +6,8 @@ class PaymentsRequiringAction end def query - Spree::Payment.joins(order: [:user]).where.not(cvv_response_message: nil). - where("spree_users.id = ?", user.id) + Spree::Payment.joins(order: [:user]).where("spree_users.id = ?", user.id). + authorization_action_required end private