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
23 changes: 23 additions & 0 deletions app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,29 @@ def warning_url
idv_session_errors_warning_url
end

def process_async_state(current_async_state)
if current_async_state.none?
idv_session.invalidate_verify_info_step!
render :show
elsif current_async_state.in_progress?
render 'shared/wait'
elsif current_async_state.missing?
analytics.idv_proofing_resolution_result_missing
flash.now[:error] = I18n.t('idv.failure.timeout')
render :show

delete_async
idv_session.invalidate_verify_info_step!

log_idv_verification_submitted_event(
success: false,
failure_reason: { idv_verification: [:timeout] },
)
elsif current_async_state.done?
async_state_done(current_async_state)
end
end

def async_state_done(current_async_state)
add_proofing_costs(current_async_state.result)
form_response = idv_result_to_form_response(
Expand Down
17 changes: 12 additions & 5 deletions app/controllers/idv/in_person/usps_locations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,28 @@ def index
render json: response.to_json
end

def proofer
@proofer ||= EnrollmentHelper.usps_proofer
end

# save the Post Office location the user selected to an enrollment
def update
enrollment.update!(
selected_location_details: update_params.as_json,
issuer: current_sp&.issuer,
)
add_proofing_component

render json: { success: true }, status: :ok
end

protected
private

def proofer
@proofer ||= EnrollmentHelper.usps_proofer
end

def add_proofing_component
ProofingComponent.
create_or_find_by(user: effective_user).
update(document_check: Idp::Constants::Vendors::USPS)
end

def handle_error(err)
remapped_error = case err
Expand Down
37 changes: 2 additions & 35 deletions app/controllers/idv/in_person/verify_info_controller.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
module Idv
module InPerson
class VerifyInfoController < ApplicationController
include IdvSession
include IdvStepConcern
include StepIndicatorConcern
include StepUtilitiesConcern
include Steps::ThreatMetrixStepHelper
include VerifyInfoConcern

before_action :renders_404_if_flag_not_set
before_action :confirm_two_factor_authenticated
before_action :confirm_ssn_step_complete
before_action :confirm_verify_info_step_needed

def show
@in_person_proofing = true
@verify_info_submit_path = idv_in_person_verify_info_path
@step_indicator_steps = step_indicator_steps

increment_step_counts
Expand Down Expand Up @@ -44,7 +42,6 @@ def update

pii[:uuid_prefix] = ServiceProvider.find_by(issuer: sp_session[:issuer])&.app_id
pii[:state_id_type] = 'drivers_license' unless pii.blank?
add_proofing_component

ssn_throttle.increment!
if ssn_throttle.throttled?
Expand Down Expand Up @@ -95,12 +92,6 @@ def renders_404_if_flag_not_set
render_not_found unless IdentityConfig.store.in_person_verify_info_controller_enabled
end

def add_proofing_component
ProofingComponent.
create_or_find_by(user: current_user).
update(document_check: Idp::Constants::Vendors::USPS)
end

# copied from address_controller
def confirm_ssn_step_complete
return if pii.present? && pii[:ssn].present?
Expand Down Expand Up @@ -147,30 +138,6 @@ def analytics_arguments
irs_reproofing: irs_reproofing?,
}.merge(**acuant_sdk_ab_test_analytics_args)
end

# copied from verify_base_step. May want reconciliation with phone_step
def process_async_state(current_async_state)
if current_async_state.none?
idv_session.resolution_successful = false
render 'idv/verify_info/show'
elsif current_async_state.in_progress?
render 'shared/wait'
elsif current_async_state.missing?
analytics.idv_proofing_resolution_result_missing
flash.now[:error] = I18n.t('idv.failure.timeout')
render 'idv/verify_info/show'

delete_async
idv_session.resolution_successful = false

log_idv_verification_submitted_event(
success: false,
failure_reason: { idv_verification: [:timeout] },
)
elsif current_async_state.done?
async_state_done(current_async_state)
end
end
end
end
end
26 changes: 0 additions & 26 deletions app/controllers/idv/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class VerifyInfoController < ApplicationController
before_action :confirm_verify_info_step_needed

def show
@in_person_proofing = false
@verify_info_submit_path = idv_verify_info_path
@step_indicator_steps = step_indicator_steps

increment_step_counts
Expand Down Expand Up @@ -123,29 +121,5 @@ def current_flow_step_counts
def increment_step_counts
current_flow_step_counts['verify'] += 1
end

# copied from verify_base_step. May want reconciliation with phone_step
def process_async_state(current_async_state)
if current_async_state.none?
idv_session.invalidate_verify_info_step!
render :show
elsif current_async_state.in_progress?
render 'shared/wait'
elsif current_async_state.missing?
analytics.idv_proofing_resolution_result_missing
flash.now[:error] = I18n.t('idv.failure.timeout')
render :show

delete_async
idv_session.invalidate_verify_info_step!

log_idv_verification_submitted_event(
success: false,
failure_reason: { idv_verification: [:timeout] },
)
elsif current_async_state.done?
async_state_done(current_async_state)
end
end
end
end
7 changes: 0 additions & 7 deletions app/services/idv/steps/in_person/verify_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def self.analytics_submitted_event

def call
pii[:state_id_type] = 'drivers_license' unless invalid_state?
add_proofing_component
enqueue_job
end

Expand All @@ -28,12 +27,6 @@ def extra_view_variables

private

def add_proofing_component
ProofingComponent.
create_or_find_by(user: current_user).
update(document_check: Idp::Constants::Vendors::USPS)
end

def capture_secondary_id_enabled?
current_user.establishing_in_person_enrollment.capture_secondary_id_enabled
end
Expand Down
Empty file.
153 changes: 153 additions & 0 deletions app/views/idv/in_person/verify_info/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<%#
locals:
@step_indicator_steps - the correct Idv::Flows variable for this flow
@pii - user's information
@had_barcode_read_failure - show warning if there's a barcode read error
%>

<% content_for(:pre_flash_content) do %>
<%= render StepIndicatorComponent.new(
steps: @step_indicator_steps,
current_step: :verify_info,
locale_scope: 'idv',
class: 'margin-x-neg-2 margin-top-neg-4 tablet:margin-x-neg-6 tablet:margin-top-neg-4',
) %>
<% end %>

<div id="form-steps-wait-alert">
<!-- Needed by form steps wait javascript -->
</div>

<% if @had_barcode_read_failure %>
<%= render AlertComponent.new(
type: :warning,
class: 'margin-bottom-4',
text_tag: 'div',
) do %>
<%= t(
'doc_auth.headings.capture_scan_warning_html',
link: render(
FormLinkComponent.new(
href: idv_doc_auth_step_path(step: :redo_document_capture),
method: :put,
).with_content(t('doc_auth.headings.capture_scan_warning_link')),
),
) %>
<% end %>
<% end %>

<% title t('titles.idv.verify_info') %>

<%= render PageHeadingComponent.new.with_content(t('headings.verify')) %>
<div class='margin-top-4 margin-bottom-2'>
<div class="grid-row grid-gap grid-gap-2 padding-bottom-1">
<dl class="grid-col-fill margin-y-0">
<div>
<dt class="display-inline"> <%= t('idv.form.first_name') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:first_name] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.last_name') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:last_name] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.dob') %>: </dt>
<dd class="display-inline margin-left-0">
<%= I18n.l(Date.parse(@pii[:dob]), format: I18n.t('time.formats.event_date')) %>
</dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.id_number') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state_id_number] %> </dd>
</div>
</dl>
<div class='grid-auto'>
<%= button_to(
idv_in_person_step_url(step: :redo_state_id),
method: :put,
class: 'usa-button usa-button--unstyled',
'aria-label': t('idv.buttons.change_state_id_label'),
) { t('idv.buttons.change_label') } %>
</div>
</div>
<div class="grid-row grid-gap grid-gap-2 padding-bottom-1 padding-top-1 border-y border-primary-light">
<dl class='grid-col-fill margin-y-0'>
<div>
<dt class="display-inline"> <%= t('idv.form.address1') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:address1] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address2') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:address2].presence %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.city') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:city] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.zipcode') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:zipcode] %> </dd>
</div>
</dl>
<div class='grid-auto'>
<%= button_to(
idv_in_person_step_url(step: :redo_address),
method: :put,
class: 'usa-button usa-button--unstyled',
'aria-label': t('idv.buttons.change_address_label'),
) { t('idv.buttons.change_label') } %>
</div>
</div>
<div class="grid-row grid-gap grid-gap-2 padding-top-1">
<div class='grid-col-fill'>
<%= t('idv.form.ssn') %>:
<%= render(
'shared/masked_text',
text: SsnFormatter.format(@pii[:ssn]),
masked_text: SsnFormatter.format_masked(@pii[:ssn]),
accessible_masked_text: t(
'idv.accessible_labels.masked_ssn',
first_number: @pii[:ssn][0],
last_number: @pii[:ssn][-1],
),
toggle_label: t('forms.ssn.show'),
) %>
</div>
<div class='grid-auto'>
<%= button_to(
idv_in_person_step_url(step: :redo_ssn),
method: :put,
class: 'usa-button usa-button--unstyled',
'aria-label': t('idv.buttons.change_ssn_label'),
) { t('idv.buttons.change_label') } %>
</div>
</div>
<div class="margin-top-5">
<%= render SpinnerButtonComponent.new(
action: ->(**tag_options, &block) do
button_to(idv_in_person_verify_info_path, **tag_options, &block)
end,
big: true,
wide: true,
action_message: t('idv.messages.verifying'),
method: :put,
form: {
class: 'button_to',
data: {
form_steps_wait: '',
error_message: t('idv.failure.exceptions.internal_error'),
alert_target: '#form-steps-wait-alert',
wait_step_path: idv_in_person_verify_info_path,
poll_interval_ms: IdentityConfig.store.poll_rate_for_verify_in_seconds * 1000,
},
},
).with_content(t('forms.buttons.continue')) %>
</div>
</div>

<% javascript_packs_tag_once 'form-steps-wait' %>
<%= render 'idv/doc_auth/cancel', step: 'verify' %>
Loading