Sha256: 65e0397e1aed08820a313c7af100d9f9d879fed0331626c4b428c376373dd2b9

Contents?: true

Size: 965 Bytes

Versions: 1

Compression:

Stored size: 965 Bytes

Contents

class Rtml::Test::SimulatorPostProcessors::CardParsers < Rtml::Test::SimulatorPostProcessors::Base
  affects 'Rtml::Test::Simulator', 'simulator'
  entry_point :check_card_parsers

  def check_card_parsers
    if !(card_readers = current_screen.card_readers).empty?
      card_readers.each do |card_reader|
        case card_reader['parser']
          when 'mag'
            process_mag_reader(card_reader['parser_params'])
          when 'emv'
            process_emv_reader(card_reader['parser_params'])
          else raise ""
        end
      end
    end
  end

  def process_mag_reader(params)
    case params
      when 'read_data' ; # nothing because this needs user input
      when 'risk_mgmt'
        variables['card.parser.verdict'] = 'online'
        continue_forward
      else raise Rtml::Errors::SimulatorError, "Invalid mag params: #{params}"
    end
  end

  def process_emv_reader(params)
    raise "EMV params not supported: #{params}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rtml-2.0.4 lib/rtml/test/simulator_post_processors/card_parsers.rb