Sha256: 0717d82c64e4f0f7f64cb27dd009d56656b7a23263303ff797911ea2a94ea22f

Contents?: true

Size: 756 Bytes

Versions: 62

Compression:

Stored size: 756 Bytes

Contents

module Workarea
  module Admin
    module CreditCardsHelper
      def credit_card_issuer_icon(issuer)
        icon_path = if card_icon_available?(issuer)
                      "workarea/admin/payment_icons/#{issuer.systemize}.svg"
                    else
                      'workarea/admin/default_card.svg'
                    end

        inline_svg(icon_path, class: "payment-icon payment-icon--#{issuer.dasherize}", title: issuer.humanize)
      end

      def card_icon_name(issuer)
        issuer.parameterize.underscore
      end

      private

      def card_icon_available?(issuer)
        return false if issuer == 'test_card'
        Workarea.config.credit_card_issuers.values.any? { |s| s.optionize == issuer }
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.4.27 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.5.4 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.26 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.5.3 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.25 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.5.2 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.24 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.5.1 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.23 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.22 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.5.0 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.21 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.5.0.beta.1 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.20 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.19 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.18 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.17 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.16 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.15 app/helpers/workarea/admin/credit_cards_helper.rb
workarea-admin-3.4.14 app/helpers/workarea/admin/credit_cards_helper.rb