Class: Paya::Certification::Tel

Inherits:
Object
  • Object
show all
Defined in:
lib/paya/certification/tel.rb

Constant Summary collapse

ROUTING_NUMBERS =
[490000018, 490000034, 490000018, 490000018]
TERMINAL_IDS =
[1210, 1211, 1214, 1215, 1212, 1213, 1217, 1216]
AMOUNTS =
[1.50, 1.84, 16.79, 1.50]
IDENTIFIERS =
{0 => 'R', 1 => 'R', 2 => 'V', 3 => 'F'}

Instance Method Summary collapse

Constructor Details

#initializeTel

Returns a new instance of Tel.



11
12
13
# File 'lib/paya/certification/tel.rb', line 11

def initialize
  # ToDO
end

Instance Method Details

#build_options(amount, routing_number, identifier) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/paya/certification/tel.rb', line 29

def build_options amount, routing_number, identifier
  {
      request_id: '4654',
      transaction_id: '0a4f529d-70fd-4ddb-b909-b5598dc07579',
      routing_number: routing_number,
      account_number: '24413815',
      account_type: 'Checking',
      check_number: 13245657478,
      first_name: 'Test',
      last_name: 'Name',
      address_1: '1001 Test Drive',
      address_2: '#200',
      city: 'Destin',
      state: 'FL',
      dl_state: 'FL',
      dl_number: 'D12346544',
      dob_year: 1951,
      zip: '32540',
      phone_number: '8001231456',
      check_amount: amount,
      identifier: identifier
  }
end

#scriptObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/paya/certification/tel.rb', line 15

def script
  log = []
  TERMINAL_IDS.each do |terminal_id|
    AMOUNTS.each_with_index do |amount, index|
      identifier = IDENTIFIERS[index]
      options = build_options amount, ROUTING_NUMBERS[index], identifier
      paya = Paya::Base.new
      pscc = paya.process_single_certification_check options, terminal_id, identifier
      log << pscc
    end
  end
  log
end