-
Notifications
You must be signed in to change notification settings - Fork 166
LG-8749: IDV TMX Fraud check event tracking #7924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ca2c35b
ebd189a
a3162ca
431b052
102a578
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,7 @@ | |
| stub_analytics | ||
| stub_attempts_tracker | ||
| allow(@analytics).to receive(:track_event) | ||
| allow(@irs_attempts_api_tracker).to receive(:track_event) | ||
| end | ||
|
|
||
| it 'renders the show template' do | ||
|
|
@@ -172,6 +173,92 @@ | |
| get :show | ||
| end | ||
| end | ||
|
|
||
| context 'when proofing_device_profiling is enabled' do | ||
| let(:idv_result) do | ||
| { | ||
| context: { | ||
| stages: { | ||
| threatmetrix: { | ||
| transaction_id: 1, | ||
| review_status: review_status, | ||
| response_body: { | ||
| tmx_summary_reason_code: ['Identity_Negative_History'], | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| errors: {}, | ||
| exception: nil, | ||
| success: true, | ||
| } | ||
| end | ||
|
|
||
| let(:document_capture_session) do | ||
| document_capture_session = DocumentCaptureSession.create!(user: user) | ||
| document_capture_session.create_proofing_session | ||
| document_capture_session.store_proofing_result(idv_result) | ||
| document_capture_session | ||
| end | ||
|
|
||
| let(:expected_failure_reason) { DocAuthHelper::SAMPLE_TMX_SUMMARY_REASON_CODE } | ||
|
|
||
| before do | ||
| controller. | ||
| idv_session.verify_info_step_document_capture_session_uuid = document_capture_session.uuid | ||
| allow(IdentityConfig.store).to receive(:proofing_device_profiling).and_return(:enabled) | ||
| allow(IdentityConfig.store).to receive(:irs_attempt_api_track_tmx_fraud_check_event). | ||
| and_return(true) | ||
| end | ||
|
|
||
| context 'when threatmetrix response is Pass' do | ||
| let(:review_status) { 'pass' } | ||
|
|
||
| it 'it logs IRS idv_tmx_fraud_check event' do | ||
| expect(@irs_attempts_api_tracker).to receive(:idv_tmx_fraud_check).with( | ||
| success: true, | ||
| failure_reason: nil, | ||
| ) | ||
| get :show | ||
| end | ||
| end | ||
|
|
||
| context 'when threatmetrix response is No Result' do | ||
| let(:review_status) { 'no_result' } | ||
|
|
||
| it 'it logs IRS idv_tmx_fraud_check event' do | ||
| expect(@irs_attempts_api_tracker).to receive(:idv_tmx_fraud_check).with( | ||
| success: false, | ||
| failure_reason: expected_failure_reason, | ||
| ) | ||
|
Comment on lines
+227
to
+233
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmhooper is this consistent with what we want for Threatmetrix no result? It's treating it as a failure. |
||
| get :show | ||
| end | ||
| end | ||
|
|
||
| context 'when threatmetrix response is Reject' do | ||
| let(:review_status) { 'reject' } | ||
|
|
||
| it 'it logs IRS idv_tmx_fraud_check event' do | ||
| expect(@irs_attempts_api_tracker).to receive(:idv_tmx_fraud_check).with( | ||
| success: false, | ||
| failure_reason: expected_failure_reason, | ||
| ) | ||
| get :show | ||
| end | ||
| end | ||
|
|
||
| context 'when threatmetrix response is Review' do | ||
| let(:review_status) { 'review' } | ||
|
|
||
| it 'it logs IRS idv_tmx_fraud_check event' do | ||
| expect(@irs_attempts_api_tracker).to receive(:idv_tmx_fraud_check).with( | ||
| success: false, | ||
| failure_reason: expected_failure_reason, | ||
| ) | ||
| get :show | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| describe '#update' do | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,5 +2,6 @@ | |
| "error_detail": "service_type", | ||
| "request_id":"1234-abcd", | ||
| "request_result":"fail_invalid_parameter", | ||
| "review_status":"REVIEW_STATUS" | ||
| "review_status":"REVIEW_STATUS", | ||
| "tmx_summary_reason_code": ["Identity_Negative_History"] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did we get this from checking production logs?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I checked the production logs and also from LN we have a lot of others as well but I just mock this only.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be a constant in DocAuthHelper, SAMPLE_TMX_SUMMARY_REASON_CODE or something like that. Along with GOOD_SSN, etc. Since it's used in 3 tests (so far). You might still have to have the explicit string in the fixtures. |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the default selected value as a pass because it was missed in #7892 PR for LG-8985 “Make Pass the default option for a mock”.