Files
openfoodnetwork/app/models/spree/payment_method/check.rb
Maikel Linke fdd22bc097 Move payment action logic to payment
At closer inspection, almost all logic around which payment actions to
display involves only the state of the payment. So I moved the logic
there.

We now have one list of all possible actions supported by the UX. Then
payment methods can declare a list of supported actions. If that's
conditional, they can implement the conditions themselves. The payment
model itself then still filters the actions based on its state.
2026-03-11 10:58:30 +11:00

28 lines
500 B
Ruby

# frozen_string_literal: true
module Spree
class PaymentMethod
class Check < Spree::PaymentMethod
def actions
%w{capture_and_complete_order void}
end
def capture(*_args)
ActiveMerchant::Billing::Response.new(true, "", {}, {})
end
def void(*_args)
ActiveMerchant::Billing::Response.new(true, "", {}, {})
end
def payment_source_class
nil
end
def source_required?
false
end
end
end
end