Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
4 changes: 4 additions & 0 deletions app/services/proofing/resolution/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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 =
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion app/services/proofing/socure/id_plus/proofer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions spec/features/idv/analytics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -112,6 +113,7 @@
errors: {},
exception: nil,
reference: '',
reason_codes: {},
success: true,
timed_out: false,
transaction_id: '',
Expand All @@ -125,6 +127,7 @@
errors: {},
exception: nil,
reference: '',
reason_codes: {},
success: false,
timed_out: false,
transaction_id: '',
Expand Down Expand Up @@ -165,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',
Expand All @@ -180,6 +184,7 @@
errors: {},
exception: nil,
reference: '',
reason_codes: {},
success: false,
timed_out: false,
transaction_id: '',
Expand Down
7 changes: 4 additions & 3 deletions spec/jobs/socure_shadow_mode_proofing_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!',
},
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions spec/services/proofing/mock/resolution_mock_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -193,6 +200,7 @@
),
timed_out: false,
reference: reference,
reason_codes: {},
transaction_id: transaction_id,
vendor_name: 'ResolutionMock',
can_pass_with_additional_verification: false,
Expand Down
2 changes: 1 addition & 1 deletion spec/services/proofing/socure/id_plus/proofer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]',
Expand Down