mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
Co-authored-by: Gaetan Craig-Riou <gaetan.riou@gmail.com> Co-authored-by: Gaetan Craig-Riou <40413322+rioug@users.noreply.github.com>
18 lines
395 B
Ruby
18 lines
395 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)&.name
|
|
end
|
|
end
|
|
end
|