Payment Icons is a simple Ruby on Rails engine extracted from Shopify. Shopify supports multiple payment methods through gems like Active Merchant and Offsite Payments. This has lead to an accumulation of icons for various payment methods. This gem provides easy access to those icons and helpful methods to integrate them into any Ruby on Rails app.
You can check out the latest source from git:
git clone https://github.com/activemerchant/payment_icons.git
Run gem install payment_icons
in your console.
If you'd like to add it to your existing Rails project, include gem 'payment_icons'
in your Gemfile and run bundle install
.
Once the gem is part of your Rails project, the PaymentIcon frozen record model will be available anywhere in your application. You also have access to all the icons with the path app/assets/images/payment_icons/<icon_name.svg>
.
For example:
<% PaymentIcon.credit_cards.each do |card| %>
<div>
<%= image_tag card.path %>
</div>
<% end %>
For information on adding or updating payment icons, see our CONTRIBUTING.md file.