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
6 changes: 6 additions & 0 deletions app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def async_state_done(current_async_state)
delete_async

if form_response.success?
save_threatmetrix_status(form_response)
move_applicant_to_idv_session
idv_session.mark_verify_info_step_complete!
idv_session.invalidate_steps_after_verify_info!
Expand All @@ -150,6 +151,11 @@ def next_step_url
idv_phone_url
end

def save_threatmetrix_status(form_response)
review_status = form_response.extra.dig(:proofing_results, :threatmetrix_review_status)
idv_session.threatmetrix_review_status = review_status
end

def summarize_result_and_throttle_failures(summary_result)
if summary_result.success?
add_proofing_components
Expand Down
1 change: 1 addition & 0 deletions app/services/idv/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Session
profile_step_params
personal_key
resolution_successful
threatmetrix_review_status
].freeze

attr_reader :current_user, :gpo_otp, :service_provider
Expand Down
23 changes: 22 additions & 1 deletion spec/controllers/idv/verify_info_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
errors: {},
exception: nil,
success: true,
threatmetrix_review_status: review_status,
}
end

Expand All @@ -205,6 +206,11 @@
context 'when threatmetrix response is Pass' do
let(:review_status) { 'pass' }

it 'sets the review status in the idv session' do
get :show
expect(controller.idv_session.threatmetrix_review_status).to eq('pass')
end

it 'it logs IRS idv_tmx_fraud_check event' do
expect(@irs_attempts_api_tracker).to receive(:idv_tmx_fraud_check).with(
success: true,
Expand All @@ -215,7 +221,12 @@
end

context 'when threatmetrix response is No Result' do
let(:review_status) { 'no_result' }
let(:review_status) { nil }

it 'sets the review status in the idv session' do
get :show
expect(controller.idv_session.threatmetrix_review_status).to be_nil
end

it 'it logs IRS idv_tmx_fraud_check event' do
expect(@irs_attempts_api_tracker).to receive(:idv_tmx_fraud_check).with(
Expand All @@ -229,6 +240,11 @@
context 'when threatmetrix response is Reject' do
let(:review_status) { 'reject' }

it 'sets the review status in the idv session' do
get :show
expect(controller.idv_session.threatmetrix_review_status).to eq('reject')
end

it 'it logs IRS idv_tmx_fraud_check event' do
expect(@irs_attempts_api_tracker).to receive(:idv_tmx_fraud_check).with(
success: false,
Expand All @@ -241,6 +257,11 @@
context 'when threatmetrix response is Review' do
let(:review_status) { 'review' }

it 'sets the review status in the idv session' do
get :show
expect(controller.idv_session.threatmetrix_review_status).to eq('review')
end

it 'it logs IRS idv_tmx_fraud_check event' do
expect(@irs_attempts_api_tracker).to receive(:idv_tmx_fraud_check).with(
success: false,
Expand Down