Skip to content
Closed
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
2 changes: 1 addition & 1 deletion app/jobs/resolution_proofing_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def perform(

if IdentityConfig.store.idv_socure_shadow_mode_enabled
Comment thread
lmgeorge marked this conversation as resolved.
SocureShadowModeProofingJob.perform_later(
document_capture_session_result_id: document_capture_session.result_id,
document_capture_session_result_id: document_capture_session&.result_id,
Comment thread
lmgeorge marked this conversation as resolved.
encrypted_arguments:,
service_provider_issuer:,
user_email: user_email_for_proofing(user),
Expand Down
2 changes: 2 additions & 0 deletions app/services/db/sp_cost/add_sp_cost.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class SpCostTypeError < StandardError; end
acuant_result
lexis_nexis_resolution
lexis_nexis_address
mock_resolution
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were previously creating SP cost records for mock resolutions as lexis_nexis_resolution. This PR now starts sending mock_resolution in those cases.

gpo_letter
socure_resolution
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking with biz ops to make sure this new SP cost type doesn't make anything explode.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chris had expressed to me a desire to have FA1 and FA3 Socure calls recorded separately, since they are separate products. I think this naming is probably a good precedent if Timnit will be socure_docauth or such.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ got the ok that sending a new sp cost type will not break anything

threatmetrix
].freeze

Expand Down
18 changes: 9 additions & 9 deletions app/services/proofing/resolution/plugins/aamva_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class AamvaPlugin
def call(
applicant_pii:,
current_sp:,
instant_verify_state_id_address_result:,
state_id_address_resolution_result:,
ipp_enrollment_in_progress:,
timer:
)
should_proof = should_proof_state_id_with_aamva?(
applicant_pii:,
instant_verify_state_id_address_result:,
state_id_address_resolution_result:,
ipp_enrollment_in_progress:,
)

Expand Down Expand Up @@ -87,35 +87,35 @@ def same_address_as_id?(applicant_pii)

def should_proof_state_id_with_aamva?(
applicant_pii:,
instant_verify_state_id_address_result:,
state_id_address_resolution_result:,
ipp_enrollment_in_progress:
)
return false unless aamva_supports_state_id_jurisdiction?(applicant_pii)
# If the user is in in-person-proofing and they have changed their address then
# they are not eligible for get-to-yes
if !ipp_enrollment_in_progress || same_address_as_id?(applicant_pii)
user_can_pass_after_state_id_check?(instant_verify_state_id_address_result:)
user_can_pass_after_state_id_check?(state_id_address_resolution_result:)
else
instant_verify_state_id_address_result.success?
state_id_address_resolution_result.success?
end
end

def user_can_pass_after_state_id_check?(
instant_verify_state_id_address_result:
state_id_address_resolution_result:
)
return true if instant_verify_state_id_address_result.success?
return true if state_id_address_resolution_result.success?

# For failed IV results, this method validates that the user is eligible to pass if the
# failed attributes are covered by the same attributes in a successful AAMVA response
# aka the Get-to-Yes w/ AAMVA feature.
if !instant_verify_state_id_address_result.
if !state_id_address_resolution_result.
failed_result_can_pass_with_additional_verification?
return false
end

attributes_aamva_can_pass = [:address, :dob, :state_id_number]
attributes_requiring_additional_verification =
instant_verify_state_id_address_result.attributes_requiring_additional_verification
state_id_address_resolution_result.attributes_requiring_additional_verification
results_that_cannot_pass_aamva =
attributes_requiring_additional_verification - attributes_aamva_can_pass

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# frozen_string_literal: true

module Proofing
module Resolution
module Plugins
class ResidentialAddressPlugin
attr_reader :proofer, :sp_cost_token

def initialize(
proofer:,
sp_cost_token:
)
@proofer = proofer
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Responsibility for creating Proofer instances is moved into ProgressiveProofer, allowing these *AddressPlugin classes to be shared between Socure / InstantVerify.

@sp_cost_token = sp_cost_token
end

def call(
applicant_pii:,
current_sp:,
ipp_enrollment_in_progress:,
timer:
)
return residential_address_unnecessary_result unless ipp_enrollment_in_progress

timer.time('residential address') do
proofer.proof(applicant_pii)
end.tap do |result|
Db::SpCost::AddSpCost.call(
current_sp,
sp_cost_token,
transaction_id: result.transaction_id,
)
end
end

def residential_address_unnecessary_result
Proofing::Resolution::Result.new(
success: true,
errors: {},
exception: nil,
vendor_name: 'ResidentialAddressNotRequired',
)
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
module Proofing
module Resolution
module Plugins
class InstantVerifyStateIdAddressPlugin
class StateIdAddressPlugin
attr_reader :proofer, :sp_cost_token

SECONDARY_ID_ADDRESS_MAP = {
identity_doc_address1: :address1,
identity_doc_address2: :address2,
Expand All @@ -12,18 +14,26 @@ class InstantVerifyStateIdAddressPlugin
identity_doc_zipcode: :zipcode,
}.freeze

def initialize(
proofer:,
sp_cost_token:
)
@proofer = proofer
@sp_cost_token = sp_cost_token
end

def call(
applicant_pii:,
current_sp:,
instant_verify_residential_address_result:,
residential_address_resolution_result:,
ipp_enrollment_in_progress:,
timer:
)
if same_address_as_id?(applicant_pii) && ipp_enrollment_in_progress
return instant_verify_residential_address_result
return residential_address_resolution_result
end

return resolution_cannot_pass unless instant_verify_residential_address_result.success?
return resolution_cannot_pass unless residential_address_resolution_result.success?

applicant_pii_with_state_id_address =
if ipp_enrollment_in_progress
Expand All @@ -37,33 +47,18 @@ def call(
end.tap do |result|
Db::SpCost::AddSpCost.call(
current_sp,
:lexis_nexis_resolution,
sp_cost_token,
transaction_id: result.transaction_id,
)
end
end

def proofer
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic moved into ProgressiveProofer

@proofer ||=
if IdentityConfig.store.proofer_mock_fallback
Proofing::Mock::ResolutionMockClient.new
else
Proofing::LexisNexis::InstantVerify::Proofer.new(
instant_verify_workflow: IdentityConfig.store.lexisnexis_instant_verify_workflow,
account_id: IdentityConfig.store.lexisnexis_account_id,
base_url: IdentityConfig.store.lexisnexis_base_url,
username: IdentityConfig.store.lexisnexis_username,
password: IdentityConfig.store.lexisnexis_password,
hmac_key_id: IdentityConfig.store.lexisnexis_hmac_key_id,
hmac_secret_key: IdentityConfig.store.lexisnexis_hmac_secret_key,
request_mode: IdentityConfig.store.lexisnexis_request_mode,
)
end
end

def resolution_cannot_pass
Proofing::Resolution::Result.new(
success: false, errors: {}, exception: nil, vendor_name: 'ResolutionCannotPass',
success: false,
errors: {},
exception: nil,
vendor_name: 'ResolutionCannotPass',
)
end

Expand Down
Loading