Files
openfoodnetwork/app/helpers/spree/payment_methods_helper.rb
2026-03-10 16:07:42 +11:00

18 lines
403 B
Ruby

# frozen_string_literal: true
module Spree
module PaymentMethodsHelper
def payment_method(payment)
# hack to allow us to retrieve the name of a "deleted" payment method
id = payment.payment_method_id
return if id.nil?
Spree::PaymentMethod.find_with_destroyed(id)
end
def payment_method_name(payment)
payment_method(payment)&.display_name
end
end
end