From 0c18203132dfbd26a657b4a917c8be0186257886 Mon Sep 17 00:00:00 2001 From: ashukla Date: Wed, 20 Aug 2025 11:15:51 -0500 Subject: [PATCH 1/5] changelog: Internal, Doc Auth, updating logs to refer to socure reason codes --- app/controllers/concerns/idv/verify_info_concern.rb | 1 + app/services/proofing/resolution/result.rb | 4 ++++ app/services/proofing/socure/id_plus/proofer.rb | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb index a128dd69b14..f70a36af513 100644 --- a/app/controllers/concerns/idv/verify_info_concern.rb +++ b/app/controllers/concerns/idv/verify_info_concern.rb @@ -197,6 +197,7 @@ def async_state_done(current_async_state) [:errors, :ssn], [:errors, :state_id_jurisdiction], [:proofing_results, :context, :stages, :resolution, :errors, :ssn], + [:proofing_results, :context, :stages, :resolution, :reason_codes], [:proofing_results, :context, :stages, :residential_address, :errors, :ssn], [:proofing_results, :context, :stages, :threatmetrix, :response_body, :first_name], [:proofing_results, :context, :stages, :state_id, :state_id_jurisdiction], diff --git a/app/services/proofing/resolution/result.rb b/app/services/proofing/resolution/result.rb index df937baa3de..e345ea766f5 100644 --- a/app/services/proofing/resolution/result.rb +++ b/app/services/proofing/resolution/result.rb @@ -13,6 +13,7 @@ class Result :failed_result_can_pass_with_additional_verification, :attributes_requiring_additional_verification, :reference, + :reason_codes, :vendor_workflow def initialize( success: nil, @@ -22,6 +23,7 @@ def initialize( transaction_id: '', customer_user_id: '', reference: '', + reason_codes: {}, failed_result_can_pass_with_additional_verification: false, attributes_requiring_additional_verification: [], vendor_workflow: nil, @@ -34,6 +36,7 @@ def initialize( @transaction_id = transaction_id @customer_user_id = customer_user_id @reference = reference + @reason_codes = reason_codes @failed_result_can_pass_with_additional_verification = failed_result_can_pass_with_additional_verification @attributes_requiring_additional_verification = @@ -60,6 +63,7 @@ def to_h timed_out: timed_out?, transaction_id: transaction_id, reference: reference, + reason_codes: reason_codes, can_pass_with_additional_verification: failed_result_can_pass_with_additional_verification, attributes_requiring_additional_verification: diff --git a/app/services/proofing/socure/id_plus/proofer.rb b/app/services/proofing/socure/id_plus/proofer.rb index 2d85337928f..27742f1db8a 100644 --- a/app/services/proofing/socure/id_plus/proofer.rb +++ b/app/services/proofing/socure/id_plus/proofer.rb @@ -68,12 +68,12 @@ def build_result_from_error(err) def build_result_from_response(response) Proofing::Resolution::Result.new( success: all_required_attributes_verified?(response), - errors: reason_codes_as_errors(response), exception: nil, vendor_name: VENDOR_NAME, verified_attributes: verified_attributes(response), transaction_id: response.reference_id, customer_user_id: response.customer_user_id, + reason_codes: reason_codes_as_errors(response), ) end From efb67e2d4a662f09175a659047e243b564d101e6 Mon Sep 17 00:00:00 2001 From: ashukla Date: Wed, 20 Aug 2025 12:40:00 -0500 Subject: [PATCH 2/5] Fixing specs --- spec/features/idv/analytics_spec.rb | 3 +++ spec/jobs/socure_shadow_mode_proofing_job_spec.rb | 7 ++++--- .../services/proofing/mock/resolution_mock_client_spec.rb | 8 ++++++++ spec/services/proofing/socure/id_plus/proofer_spec.rb | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 0db3d55f614..cddce0448c6 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -87,6 +87,7 @@ timed_out: false, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc', + reason_codes: {}, can_pass_with_additional_verification: false, attributes_requiring_additional_verification: [], vendor_name: 'ResolutionMock', @@ -112,6 +113,7 @@ errors: {}, exception: nil, reference: '', + reason_codes: {}, success: true, timed_out: false, transaction_id: '', @@ -125,6 +127,7 @@ errors: {}, exception: nil, reference: '', + reason_codes: {}, success: false, timed_out: false, transaction_id: '', diff --git a/spec/jobs/socure_shadow_mode_proofing_job_spec.rb b/spec/jobs/socure_shadow_mode_proofing_job_spec.rb index aa5970102e3..daa56c87287 100644 --- a/spec/jobs/socure_shadow_mode_proofing_job_spec.rb +++ b/spec/jobs/socure_shadow_mode_proofing_job_spec.rb @@ -269,7 +269,8 @@ socure_result: { attributes_requiring_additional_verification: [], can_pass_with_additional_verification: false, - errors: { + errors: {}, + reason_codes: { 'I123' => 'Person is over seven feet tall.', 'R890' => 'Help! I am trapped in a reason code factory!', }, @@ -403,8 +404,8 @@ expect(analytics).to have_logged_event( :idv_socure_shadow_mode_proofing_result, satisfy do |attributes| - errors = attributes.dig(:socure_result, :errors) - expect(errors).to include( + reason_codes = attributes.dig(:socure_result, :reason_codes) + expect(reason_codes).to include( 'I000' => '[unknown]', ) end, diff --git a/spec/services/proofing/mock/resolution_mock_client_spec.rb b/spec/services/proofing/mock/resolution_mock_client_spec.rb index 4214551886a..a11fcb583ee 100644 --- a/spec/services/proofing/mock/resolution_mock_client_spec.rb +++ b/spec/services/proofing/mock/resolution_mock_client_spec.rb @@ -23,6 +23,7 @@ exception: nil, timed_out: false, reference: reference, + reason_codes: {}, transaction_id: transaction_id, vendor_name: 'ResolutionMock', can_pass_with_additional_verification: false, @@ -47,6 +48,7 @@ exception: nil, timed_out: false, reference: reference, + reason_codes: {}, transaction_id: transaction_id, vendor_name: 'ResolutionMock', can_pass_with_additional_verification: false, @@ -71,6 +73,7 @@ exception: nil, timed_out: false, reference: reference, + reason_codes: {}, transaction_id: transaction_id, vendor_name: 'ResolutionMock', can_pass_with_additional_verification: false, @@ -95,6 +98,7 @@ exception: nil, timed_out: false, reference: reference, + reason_codes: {}, transaction_id: transaction_id, vendor_name: 'ResolutionMock', can_pass_with_additional_verification: false, @@ -119,6 +123,7 @@ exception: RuntimeError.new('Failed to contact proofing vendor'), timed_out: false, reference: reference, + reason_codes: {}, transaction_id: transaction_id, vendor_name: 'ResolutionMock', can_pass_with_additional_verification: false, @@ -143,6 +148,7 @@ exception: RuntimeError.new('Failed to contact proofing vendor'), timed_out: false, reference: reference, + reason_codes: {}, transaction_id: transaction_id, vendor_name: 'ResolutionMock', can_pass_with_additional_verification: false, @@ -167,6 +173,7 @@ exception: Proofing::TimeoutError.new('resolution mock timeout'), timed_out: true, reference: reference, + reason_codes: {}, transaction_id: transaction_id, vendor_name: 'ResolutionMock', can_pass_with_additional_verification: false, @@ -193,6 +200,7 @@ ), timed_out: false, reference: reference, + reason_codes: {}, transaction_id: transaction_id, vendor_name: 'ResolutionMock', can_pass_with_additional_verification: false, diff --git a/spec/services/proofing/socure/id_plus/proofer_spec.rb b/spec/services/proofing/socure/id_plus/proofer_spec.rb index 469610514be..ee06b37742b 100644 --- a/spec/services/proofing/socure/id_plus/proofer_spec.rb +++ b/spec/services/proofing/socure/id_plus/proofer_spec.rb @@ -71,7 +71,7 @@ end it 'reports reason codes as errors' do - expect(result.errors).to eql( + expect(result.reason_codes).to eql( { 'I905' => '[unknown]', 'I914' => '[unknown]', From 1ab40cd13577e2ea4a10369dbcd321b156b2cca0 Mon Sep 17 00:00:00 2001 From: ashukla Date: Wed, 20 Aug 2025 13:43:47 -0500 Subject: [PATCH 3/5] Updating analytics spec --- spec/features/idv/analytics_spec.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index cddce0448c6..8b69148da8e 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -113,7 +113,6 @@ errors: {}, exception: nil, reference: '', - reason_codes: {}, success: true, timed_out: false, transaction_id: '', @@ -127,7 +126,6 @@ errors: {}, exception: nil, reference: '', - reason_codes: {}, success: false, timed_out: false, transaction_id: '', From 06048425f72d3a4f14c1d61e63944330ef1102b9 Mon Sep 17 00:00:00 2001 From: ashukla Date: Wed, 20 Aug 2025 13:56:55 -0500 Subject: [PATCH 4/5] Updating analytics spec with reason_codes --- spec/features/idv/analytics_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 8b69148da8e..cddce0448c6 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -113,6 +113,7 @@ errors: {}, exception: nil, reference: '', + reason_codes: {}, success: true, timed_out: false, transaction_id: '', @@ -126,6 +127,7 @@ errors: {}, exception: nil, reference: '', + reason_codes: {}, success: false, timed_out: false, transaction_id: '', From 8246d7be33cb488e3546d69537e508525d8345b8 Mon Sep 17 00:00:00 2001 From: ashukla Date: Wed, 20 Aug 2025 15:19:26 -0500 Subject: [PATCH 5/5] updating ipp check in analytics spec --- spec/features/idv/analytics_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index cddce0448c6..e4a220f134c 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -168,6 +168,7 @@ residential_address: { errors: {}, exception: nil, reference: 'aaa-bbb-ccc', + reason_codes: {}, success: true, timed_out: false, transaction_id: 'resolution-mock-transaction-id-123', @@ -183,6 +184,7 @@ errors: {}, exception: nil, reference: '', + reason_codes: {}, success: false, timed_out: false, transaction_id: '',