Sha256: 989e95a5dfea776654969b411672d29d9350665f496bf08c489bc522960ab21d

Contents?: true

Size: 575 Bytes

Versions: 2

Compression:

Stored size: 575 Bytes

Contents

# frozen_string_literal: true

require_relative "providers/bincodes"
require_relative "providers/credit_card_bins"

module CreditCardInfo
  module Proxy
    # @return [Hash, NilClass] bin description
    def self.fetch(code)
      bincode_response = Providers::Bincodes.fetch(code)
      return bincode_response.data if bincode_response.valid?

      bincode_response.log_error

      card_bins_response = Providers::CreditCardBins.fetch(code)
      return card_bins_response.data if card_bins_response.valid?

      card_bins_response.log_error

      nil
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
credit_card_info-0.1.1 lib/credit_card_info/proxy.rb
credit_card_info-0.1.0 lib/credit_card_info/proxy.rb