Class: Rtml::Test::SimulatorPostProcessors::CardParsers

Inherits:
Base
  • Object
show all
Defined in:
lib/rtml/test/simulator_post_processors/card_parsers.rb

Instance Method Summary collapse

Instance Method Details

#check_card_parsersObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rtml/test/simulator_post_processors/card_parsers.rb', line 5

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

#process_emv_reader(params) ⇒ Object



29
30
31
# File 'lib/rtml/test/simulator_post_processors/card_parsers.rb', line 29

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

#process_mag_reader(params) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/rtml/test/simulator_post_processors/card_parsers.rb', line 19

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