Remove unnecessary guard clause

Previously, payment actions that were listed without an associated
`can_?` method were interpreted as supported. All payment methods are
implementing all `can_?` methods for listed actions though. And I think
that new payment methods should explicitely implement all `can_?`
methods instead of relying on this hidden logic.
This commit is contained in:
Maikel Linke
2026-02-17 14:43:18 +11:00
parent 2b32f6b909
commit 956c4a27c2

View File

@@ -155,8 +155,7 @@ module Spree
return [] unless payment_method.respond_to?(:actions)
payment_method.actions.select do |action|
!payment_method.respond_to?("can_#{action}?") ||
payment_method.__send__("can_#{action}?", self)
payment_method.__send__("can_#{action}?", self)
end
end