Class: Experian::ConnectCheck::Response

Inherits:
Response
  • Object
show all
Defined in:
lib/experian/connect_check/response.rb

Instance Attribute Summary

Attributes inherited from Response

#xml

Instance Method Summary collapse

Methods inherited from Response

#completion_code, #completion_message, #error?, #error_action_indicator, #error_action_indicator_message, #error_code, #error_message, #error_message_segment, #error_segment, #header_segment, #host_response, #initialize, #segment, #segments, #success?, #transaction_id

Constructor Details

This class inherits a constructor from Experian::Response

Instance Method Details

#credit_class_codeObject



19
20
21
22
# File 'lib/experian/connect_check/response.rb', line 19

def credit_class_code
  return unless connect_check_segment
  connect_check_segment[10]
end

#credit_fraud_codeObject



34
35
36
37
38
39
40
# File 'lib/experian/connect_check/response.rb', line 34

def credit_fraud_code
  case statement_type_code
  when 25 then 'X' # file frozen due to state legislation
  when 26..31 then 'Y' # active credit alerts
  else 'Z' # assume no fraud
  end if success?
end

#credit_match_codeObject



10
11
12
13
# File 'lib/experian/connect_check/response.rb', line 10

def credit_match_code
  return unless connect_check_segment
  connect_check_segment[8]
end

#credit_match_code_messageObject



15
16
17
# File 'lib/experian/connect_check/response.rb', line 15

def credit_match_code_message
  MATCH_CODES[credit_match_code]
end

#credit_scoreObject



24
25
26
27
# File 'lib/experian/connect_check/response.rb', line 24

def credit_score
  return unless risk_score_segment
  risk_score_segment[7..10].to_i
end

#customer_addressesObject



63
64
65
66
67
# File 'lib/experian/connect_check/response.rb', line 63

def customer_addresses
  segments(336).map do |segment|
    segment[36, segment[34..35].to_i]
  end
end

#customer_messageObject



74
75
76
77
# File 'lib/experian/connect_check/response.rb', line 74

def customer_message
  return unless connect_check_segment
  connect_check_segment[25 + customer_name_length + 2, customer_message_length]
end

#customer_message_lengthObject



69
70
71
72
# File 'lib/experian/connect_check/response.rb', line 69

def customer_message_length
  return unless connect_check_segment
  connect_check_segment[25 + customer_name_length, 2].to_i
end

#customer_nameObject



52
53
54
55
# File 'lib/experian/connect_check/response.rb', line 52

def customer_name
  return unless connect_check_segment
  connect_check_segment[25, customer_name_length]
end

#customer_name_lengthObject



47
48
49
50
# File 'lib/experian/connect_check/response.rb', line 47

def customer_name_length
  return unless connect_check_segment
  connect_check_segment[23..25].to_i
end

#customer_namesObject



57
58
59
60
61
# File 'lib/experian/connect_check/response.rb', line 57

def customer_names
  segments(335).map do |segment|
    segment[9, segment[7..8].to_i]
  end
end

#high_risk_address_alertObject



29
30
31
32
# File 'lib/experian/connect_check/response.rb', line 29

def high_risk_address_alert
  return unless connect_check_segment
  connect_check_segment[11]
end

#input_typeObject



5
6
7
8
# File 'lib/experian/connect_check/response.rb', line 5

def input_type
  return unless connect_check_segment
  connect_check_segment[7]
end

#statement_type_codeObject



42
43
44
45
# File 'lib/experian/connect_check/response.rb', line 42

def statement_type_code
  return unless consumer_statement_segment
  consumer_statement_segment[7..8].to_i
end