diff --git a/backend/app/helpers/spree/admin/payments_helper.rb b/backend/app/helpers/spree/admin/payments_helper.rb index 0c2d8305d70..0af64320774 100644 --- a/backend/app/helpers/spree/admin/payments_helper.rb +++ b/backend/app/helpers/spree/admin/payments_helper.rb @@ -4,6 +4,7 @@ module Spree module Admin module PaymentsHelper def payment_method_name(payment) + Spree::Deprecation.warn "payment_method_name(payment) is deprecated. Instead use payment.payment_method.name" payment.payment_method.name end end diff --git a/backend/app/views/spree/admin/orders/confirm/_payments.html.erb b/backend/app/views/spree/admin/orders/confirm/_payments.html.erb index 6c68dfef4b3..a6b4daf20ea 100644 --- a/backend/app/views/spree/admin/orders/confirm/_payments.html.erb +++ b/backend/app/views/spree/admin/orders/confirm/_payments.html.erb @@ -24,7 +24,7 @@ <%= payment.display_amount.to_html %> - <%= payment_method_name(payment) %> + <%= payment.payment_method.name %> <%= payment.transaction_id %> diff --git a/backend/app/views/spree/admin/payments/_list.html.erb b/backend/app/views/spree/admin/payments/_list.html.erb index f8fda829bd2..07767809b21 100644 --- a/backend/app/views/spree/admin/payments/_list.html.erb +++ b/backend/app/views/spree/admin/payments/_list.html.erb @@ -24,7 +24,7 @@ <%= link_to payment.number, spree.admin_order_payment_path(@order, payment) %> <%= l(payment.created_at, format: :short) %> - <%= payment_method_name(payment) %> + <%= payment.payment_method.name %> <%= payment.transaction_id %> diff --git a/backend/app/views/spree/admin/payments/show.html.erb b/backend/app/views/spree/admin/payments/show.html.erb index b49a727c627..93a99f3f2ab 100644 --- a/backend/app/views/spree/admin/payments/show.html.erb +++ b/backend/app/views/spree/admin/payments/show.html.erb @@ -2,7 +2,7 @@ <% admin_breadcrumb(link_to plural_resource_name(Spree::Payment), spree.admin_order_payments_path(@order)) %> <% admin_breadcrumb do %> - <%= payment_method_name(@payment) %> + <%= @payment.payment_method.name %> <%= t(@payment.state, scope: 'spree.payment_states') %> diff --git a/backend/app/views/spree/admin/shared/_refunds.html.erb b/backend/app/views/spree/admin/shared/_refunds.html.erb index 797652b910a..9987c785a0a 100644 --- a/backend/app/views/spree/admin/shared/_refunds.html.erb +++ b/backend/app/views/spree/admin/shared/_refunds.html.erb @@ -18,7 +18,7 @@ <%= pretty_time(refund.created_at) %> <%= refund.payment.number %> <%= refund.display_amount %> - <%= payment_method_name(refund.payment) %> + <%= refund.payment.payment_method.name %> <%= refund.transaction_id %> <%= truncate(refund.reason.name, length: 100) %> <% if show_actions %>