Add method payment_method to get the payment method from a payment

- Method `payment_method_name` now use `payment_method`
This commit is contained in:
Jean-Baptiste Bellet
2021-05-05 10:10:24 +02:00
parent 5560a99423
commit aea0670268

View File

@@ -1,9 +1,13 @@
module Spree
module PaymentMethodsHelper
def payment_method_name(payment)
def payment_method(payment)
# hack to allow us to retrieve the name of a "deleted" payment method
id = payment.payment_method_id
Spree::PaymentMethod.find_with_destroyed(id).name
Spree::PaymentMethod.find_with_destroyed(id)
end
def payment_method_name(payment)
payment_method(payment).name
end
end
end