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
5 changes: 4 additions & 1 deletion app/controllers/idv/document_capture_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def show

def update
flow_session['redo_document_capture'] = nil # done with this redo
idv_session.redo_document_capture = nil # done with this redo
result = handle_stored_result
analytics.idv_doc_auth_document_capture_submitted(**result.to_h.merge(analytics_arguments))

Expand Down Expand Up @@ -56,6 +57,7 @@ def confirm_hybrid_handoff_complete

def confirm_document_capture_needed
return if flow_session['redo_document_capture']
return if idv_session.redo_document_capture

pii = flow_session['pii_from_doc'] # hash with indifferent access
return if pii.blank? && !idv_session.verify_info_step_complete?
Expand All @@ -74,7 +76,8 @@ def analytics_arguments
step: 'document_capture',
analytics_id: 'Doc Auth',
irs_reproofing: irs_reproofing?,
redo_document_capture: flow_session[:redo_document_capture],
redo_document_capture:
idv_session.redo_document_capture || flow_session[:redo_document_capture],
}.compact.merge(ab_test_analytics_buckets)
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/hybrid_handoff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ def confirm_hybrid_handoff_needed

def setup_for_redo
flow_session[:redo_document_capture] = true
idv_session.redo_document_capture = true

# If we previously skipped hybrid handoff for the user (because they're on a mobile
# device with a camera), skip it _again_ here.

if idv_session.skip_hybrid_handoff?
idv_session.flow_path = 'standard'
else
Expand Down
1 change: 1 addition & 0 deletions app/controllers/idv/link_sent_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def confirm_hybrid_handoff_complete

def confirm_document_capture_needed
return if flow_session['redo_document_capture']
return if idv_session.redo_document_capture

pii = flow_session['pii_from_doc'] # hash with indifferent access
return if pii.blank? && !idv_session.verify_info_step_complete?
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/idv/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ def update

if success
# Don't allow the user to go back to document capture after verifying
if flow_session['redo_document_capture']
if flow_session['redo_document_capture'] || idv_session.redo_document_capture
flow_session.delete('redo_document_capture')
idv_session.redo_document_capture = nil
idv_session.flow_path ||= 'standard'
end

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 @@ -18,6 +18,7 @@ class Session
profile_confirmation
profile_id
profile_step_params
redo_document_capture
resolution_successful
skip_hybrid_handoff
threatmetrix_review_status
Expand Down
11 changes: 10 additions & 1 deletion spec/controllers/idv/document_capture_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,23 @@
end

context 'redo_document_capture' do
it 'adds redo_document_capture to analytics' do
it 'adds redo_document_capture to analytics using flow_session' do
flow_session[:redo_document_capture] = true

get :show

analytics_args[:redo_document_capture] = true
expect(@analytics).to have_logged_event(analytics_name, analytics_args)
end

it 'adds redo_document_capture to analytics using idv_session' do
subject.idv_session.redo_document_capture = true

get :show

analytics_args[:redo_document_capture] = true
expect(@analytics).to have_logged_event(analytics_name, analytics_args)
end
end

it 'updates DocAuthLog document_capture_view_count' do
Expand Down