diff --git a/app/services/doc_auth/lexis_nexis/doc_pii_reader.rb b/app/services/doc_auth/lexis_nexis/doc_pii_reader.rb index 79a46b11d64..f9360503542 100644 --- a/app/services/doc_auth/lexis_nexis/doc_pii_reader.rb +++ b/app/services/doc_auth/lexis_nexis/doc_pii_reader.rb @@ -22,6 +22,7 @@ module DocPiiReader # @return [Pii::StateId, nil] def read_pii(true_id_product) id_auth_field_data = true_id_product&.dig(:IDAUTH_FIELD_DATA) + authentication_result_field_data = true_id_product&.dig(:AUTHENTICATION_RESULT) return nil unless id_auth_field_data.present? state_id_type_slug = id_auth_field_data['Fields_DocumentClassName'] @@ -42,7 +43,7 @@ def read_pii(true_id_product) month: id_auth_field_data['Fields_DOB_Month'], day: id_auth_field_data['Fields_DOB_Day'], ), - sex: parse_sex_value(id_auth_field_data['Fields_Sex']), + sex: parse_sex_value(authentication_result_field_data&.[]('Sex')), height: parse_height_value(id_auth_field_data['Fields_Height']), weight: nil, eye_color: nil, @@ -87,10 +88,10 @@ def parse_sex_value(sex_attribute) # This code will return `nil` for those cases with the intent that they will not be verified # against the DLDV where they will not be recognized # - case sex_attribute&.upcase - when 'M' + case sex_attribute + when 'Male' 'male' - when 'F' + when 'Female' 'female' end end diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode.json index b65a8b12672..4ec00edb41f 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode.json @@ -694,11 +694,6 @@ "Name": "Fields_PostalCode", "Values": [{"Value": "12345"}] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [{"Value": "M"}] - }, { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_Height", diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode_with_face_match_fail.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode_with_face_match_fail.json index b2a6d6421d2..fc51458f48b 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode_with_face_match_fail.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode_with_face_match_fail.json @@ -714,11 +714,6 @@ "Name": "Fields_PostalCode", "Values": [{"Value": "12345"}] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [{"Value": "M"}] - }, { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_Height", diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failed_to_ocr_dob.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failed_to_ocr_dob.json index 2e151deb30e..fedcb07d700 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failed_to_ocr_dob.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failed_to_ocr_dob.json @@ -409,12 +409,7 @@ "Name": "Fields_PostalCode", "Values": [{"Value": "12345"}] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [{"Value": "M"}] - }, - { + { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_ControlNumber", "Values": [{"Value": "6820051160"}] diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_no_liveness.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_no_liveness.json index d47c7b52a28..8ef023d6c7c 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_no_liveness.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_no_liveness.json @@ -674,11 +674,6 @@ "Name": "Fields_PostalCode", "Values": [{"Value": "02809-2366"}] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [{"Value": "M"}] - }, { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_ControlNumber", diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_no_liveness_low_dpi.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_no_liveness_low_dpi.json index 040084be529..b86089bc0d7 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_no_liveness_low_dpi.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_no_liveness_low_dpi.json @@ -669,11 +669,6 @@ "Name": "Fields_PostalCode", "Values": [{"Value": "02809-2366"}] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [{"Value": "M"}] - }, { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_ControlNumber", diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_all_failures.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_all_failures.json index 3d3282e16f2..2caf549db4e 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_all_failures.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_all_failures.json @@ -669,11 +669,6 @@ "Name": "Fields_PostalCode", "Values": [{"Value": "02809-2366"}] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [{"Value": "M"}] - }, { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_ControlNumber", diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_face_match_fail.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_face_match_fail.json index af9221a5f71..6da199b0bf9 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_face_match_fail.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_face_match_fail.json @@ -669,11 +669,6 @@ "Name": "Fields_PostalCode", "Values": [{"Value": "02809-2366"}] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [{"Value": "M"}] - }, { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_ControlNumber", @@ -737,4 +732,4 @@ } } ] -} \ No newline at end of file +} diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_face_match_pass.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_face_match_pass.json index d82cd53bb5a..9c32330a468 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_face_match_pass.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_face_match_pass.json @@ -669,11 +669,6 @@ "Name": "Fields_PostalCode", "Values": [{"Value": "02809-2366"}] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [{"Value": "M"}] - }, { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_ControlNumber", diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_liveness.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_liveness.json index 9ae6ac15f2c..13aeae5800a 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_liveness.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_failure_with_liveness.json @@ -669,11 +669,6 @@ "Name": "Fields_PostalCode", "Values": [{"Value": "02809-2366"}] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [{"Value": "M"}] - }, { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_ControlNumber", diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_success.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_success.json index 6b171049751..1439c76561e 100644 --- a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_success.json +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_success.json @@ -697,15 +697,6 @@ } ] }, - { - "Group": "IDAUTH_FIELD_DATA", - "Name": "Fields_Sex", - "Values": [ - { - "Value": "M" - } - ] - }, { "Group": "IDAUTH_FIELD_DATA", "Name": "Fields_ControlNumber", diff --git a/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb b/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb index 4a2e5bb4dec..9c64557a9c1 100644 --- a/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb +++ b/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb @@ -133,7 +133,7 @@ city: 'ANYTOWN', state: 'MD', dob: '1986-07-01', - sex: nil, + sex: 'male', height: 69, weight: nil, eye_color: nil,