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.

Fixed: remove `payment_icons` gem leftover (#13241)

Damian Legawiec5f2e803ab6b9
diff --git a/storefront/app/helpers/spree/payment_methods_helper.rb b/storefront/app/helpers/spree/payment_methods_helper.rb
new file mode 100644
index 0000000000..ef40bf260b
--- /dev/null
+++ b/storefront/app/helpers/spree/payment_methods_helper.rb
@@ -0,0 +1,7 @@
+module Spree
+ module PaymentMethodsHelper
+ def credit_card_icons
+ %w[visa mastercard american_express discover]
+ end
+ end
+end
diff --git a/storefront/app/views/spree/checkout/payment/_gateway.html.erb b/storefront/app/views/spree/checkout/payment/_gateway.html.erb
index 531c2f9ae5..c2a181ce32 100644
--- a/storefront/app/views/spree/checkout/payment/_gateway.html.erb
+++ b/storefront/app/views/spree/checkout/payment/_gateway.html.erb
@@ -65,9 +65,9 @@
data: { card_validation_target: "ccType" }
%>
- <% PaymentIcon.credit_cards.each do |card| %>
- <div id="credit-card-icon-<%= card.name %>" class="hidden">
- <%= image_tag card.path, style: 'height: 32px;' %>
+ <% credit_card_icons.each do |card| %>
+ <div id="credit-card-icon-<%= card %>" class="hidden">
+ <%= payment_method_icon_tag card %>
</div>
<% end %>
</div>