From f2b407c194245cc59e17aa0a3ebf86d2198d4368 Mon Sep 17 00:00:00 2001 From: Ana Nunes da Silva Date: Mon, 6 Feb 2023 11:32:43 +0000 Subject: [PATCH] Add :void scope in Spree::Payment --- app/models/spree/payment.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index 3d6e59ea36..33aac13d66 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -51,6 +51,7 @@ module Spree scope :pending, -> { with_state('pending') } scope :failed, -> { with_state('failed') } scope :valid, -> { where.not(state: %w(failed invalid)) } + scope :void, -> { with_state('void') } scope :authorization_action_required, -> { where.not(cvv_response_message: nil) } scope :requires_authorization, -> { with_state("requires_authorization") } scope :with_payment_intent, ->(code) { where(response_code: code) }