Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Add ability for 3rd party payment methods to define their custom paym… (#12812)

Damian Legawiec28d8eac240f2
diff --git a/core/app/views/spree/shared/_payment.html.erb b/core/app/views/spree/shared/_payment.html.erb
index 8f9621a1a2..a8682abce1 100644
--- a/core/app/views/spree/shared/_payment.html.erb
+++ b/core/app/views/spree/shared/_payment.html.erb
@@ -30,6 +30,15 @@
<div class="flex-shrink-0">
<%= payment_method_icon_tag source.class.to_s.demodulize.downcase, height: 30 %>
</div>
+ <div>
+ <% if payment.payment_method.respond_to?(:source_partial_name) %>
+ <%= render partial: "spree/payment_sources/#{payment.payment_method.source_partial_name}", locals: { payment: payment, source: source } %>
+ <% elsif source.respond_to?(:name) %>
+ <%= source.name %>
+ <% else %>
+ <%= source.class.to_s.demodulize.downcase %>
+ <% end %>
+ </div>
<% else %>
<div class="flex-shrink-0">
<%= payment_method_icon_tag payment.payment_method.payment_icon_name %>