diff --git a/app/services/proofing/lexis_nexis/verification_error_parser.rb b/app/services/proofing/lexis_nexis/verification_error_parser.rb index 665c4f5cee9..25e40c09827 100644 --- a/app/services/proofing/lexis_nexis/verification_error_parser.rb +++ b/app/services/proofing/lexis_nexis/verification_error_parser.rb @@ -47,11 +47,10 @@ def parse_product_error_messages return {} if products.nil? products.each_with_object({}) do |product, error_messages| - if product['ProductType'] == 'InstantVerify' - next if product['ProductStatus'] == 'pass' - elsif product['ProductStatus'] == 'pass' - next - end + next if product['ProductStatus'] == 'pass' + + # don't log PhoneFinder reflected PII + product.delete('ParameterDetails') if product['ProductType'] == 'PhoneFinder' key = product.fetch('ExecutedStepName').to_sym error_messages[key] = product diff --git a/spec/fixtures/proofing/lexis_nexis/phone_finder/fail_response.json b/spec/fixtures/proofing/lexis_nexis/phone_finder/rdp1_fail_response.json similarity index 100% rename from spec/fixtures/proofing/lexis_nexis/phone_finder/fail_response.json rename to spec/fixtures/proofing/lexis_nexis/phone_finder/rdp1_fail_response.json diff --git a/spec/fixtures/proofing/lexis_nexis/phone_finder/response.json b/spec/fixtures/proofing/lexis_nexis/phone_finder/rdp1_response.json similarity index 100% rename from spec/fixtures/proofing/lexis_nexis/phone_finder/response.json rename to spec/fixtures/proofing/lexis_nexis/phone_finder/rdp1_response.json diff --git a/spec/fixtures/proofing/lexis_nexis/phone_finder/rdp2_fail_response.json b/spec/fixtures/proofing/lexis_nexis/phone_finder/rdp2_fail_response.json new file mode 100644 index 00000000000..a80b511ef73 --- /dev/null +++ b/spec/fixtures/proofing/lexis_nexis/phone_finder/rdp2_fail_response.json @@ -0,0 +1,695 @@ +{ + "Status": { + "ConversationId": "3100000000000", + "RequestId": "2xxxxxx", + "TransactionStatus": "failed", + "TransactionReasonCode": { + "Code": "phone_finder_fail", + "Description": "Phone Finder Fail" + } + }, + "Products": [ + { + "ProductType": "PhoneFinder", + "ExecutedStepName": "PhoneFinder", + "ProductConfigurationName": "xxxxxPhoneFinder", + "ProductStatus": "fail", + "ProductReason": { + "Code": "phone_finder_fail", + "Description": "Phone Finder Fail" + }, + "Items": [ + { + "ItemName": "PrepaidPhoneNumber", + "ItemStatus": "pass" + }, + { + "ItemName": "LastChangeDateIMEI", + "ItemStatus": "pass" + }, + { + "ItemName": "NoContractCarrier", + "ItemStatus": "pass" + }, + { + "ItemName": "VOIPPhone", + "ItemStatus": "pass" + }, + { + "ItemName": "LastChangeDateIMSI", + "ItemStatus": "pass" + }, + { + "ItemName": "SurnameMismatch", + "ItemStatus": "pass" + }, + { + "ItemName": "LostStolen", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneReturnedOften", + "ItemStatus": "pass" + }, + { + "ItemName": "WirelessServiceType", + "ItemStatus": "fail", + "ItemReason": { + "Code": "WirelessServiceType.LOW", + "Description": "Phone Service Type is Wireless" + } + }, + { + "ItemName": "SourceSelfReported", + "ItemStatus": "pass" + }, + { + "ItemName": "LandlineServiceType", + "ItemStatus": "pass" + }, + { + "ItemName": "CableServiceType", + "ItemStatus": "pass" + }, + { + "ItemName": "UnknownServiceType", + "ItemStatus": "pass" + }, + { + "ItemName": "1stFirstSeenDate", + "ItemStatus": "pass" + }, + { + "ItemName": "2ndFirstSeenDate", + "ItemStatus": "pass" + }, + { + "ItemName": "PhonePorted2ndRange", + "ItemStatus": "pass" + }, + { + "ItemName": "3rdFirstSeenDate", + "ItemStatus": "pass" + }, + { + "ItemName": "PhonePorted3rdRange", + "ItemStatus": "pass" + }, + { + "ItemName": "PhonePorted", + "ItemStatus": "pass" + }, + { + "ItemName": "FrequentlyPhonePorted", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneSpoofedNumOfDays", + "ItemStatus": "pass" + }, + { + "ItemName": "SpoofingPhoneNumber", + "ItemStatus": "pass" + }, + { + "ItemName": "SpoofingDestination", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneAssociatedWithMoreThanXIdentities", + "ItemStatus": "pass" + }, + { + "ItemName": "EmailCount(Month)", + "ItemStatus": "pass" + }, + { + "ItemName": "DeviceCount(Month)", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneHighCountryCount", + "ItemStatus": "pass" + }, + { + "ItemName": "RecentPhoneFirstSeen", + "ItemStatus": "pass" + }, + { + "ItemName": "DigitalIDBadReputation", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneNumberAssociatedWithFraud", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneInRejectedTransaction", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneSearch", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneOnGlobalBlacklist", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneOTPRequest", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneNotActive", + "ItemStatus": "pass" + }, + { + "ItemName": "SpoofedPhoneNumber", + "ItemStatus": "pass" + }, + { + "ItemName": "SubjectIsBusiness", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneForwarding", + "ItemStatus": "pass" + }, + { + "ItemName": "SubjectDeceased", + "ItemStatus": "pass" + }, + { + "ItemName": "NoFirstSeenDate", + "ItemStatus": "fail", + "ItemReason": { + "Code": "NoFirstSeenDate.MEDIUM", + "Description": "No First Seen Date associated to Phone #" + } + }, + { + "ItemName": "CommercialAddress", + "ItemStatus": "pass" + }, + { + "ItemName": "NoLastSeenDate", + "ItemStatus": "fail", + "ItemReason": { + "Code": "NoLastSeenDate.LOW", + "Description": "No Last Seen Date associated to Phone #" + } + }, + { + "ItemName": "MismatchAreaCodeAndAddressArea", + "ItemStatus": "pass" + }, + { + "ItemName": "NoFirstAndLastSeenDate", + "ItemStatus": "fail", + "ItemReason": { + "Code": "NoFirstAndLastSeenDate.HIGH", + "Description": "No First Seen and Last Seen Date associated to Phone #" + } + }, + { + "ItemName": "NotCurrentAddress", + "ItemStatus": "pass" + }, + { + "ItemName": "LastSeenDateAge", + "ItemStatus": "pass" + } + ], + "ParameterDetails": [ + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_LexIDs", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Deceased_Indicators", + "Values": [ + { + "Value": "N" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Full_Names", + "Values": [ + { + "Value": "PII" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Street_1s", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Street_2s", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_StateCityZIPs", + "Values": [ + { + "Value": "PII" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Time_With_Phones", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Time_Last_Seen_With_Phones", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Address_Types", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Address_Statuses", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Call_Forwarding_Indicator", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Number", + "Values": [ + { + "Value": "xxxxxxxx" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Type", + "Values": [ + { + "Value": "POSSIBLE WIRELESS" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Carrier", + "Values": [ + { + "Value": "VERIZON WIRELESS" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Listing_Name", + "Values": [ + { + "Value": "PII" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Status", + "Values": [ + { + "Value": "ACTIVE" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Listing_Type", + "Values": [ + { + "Value": "RESIDENTIAL" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Address_Type", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Port_Code", + "Values": [ + { + "Value": "Ported" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Caller_ID", + "Values": [ + { + "Value": "PII" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Port_Count", + "Values": [ + { + "Value": "1" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Activation_Year", + "Values": [ + { + "Value": "2018" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Phone_Verification_Indicator", + "Values": [ + { + "Value": "1" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Activation_Month", + "Values": [ + { + "Value": "07" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Activation_Day", + "Values": [ + { + "Value": "04" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_No_Contract_Carrier", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Operating_Company", + "Values": [ + { + "Value": "VERIZON WIRELESS" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Phone_Verification_Msg", + "Values": [ + { + "Value": "Input phone number matches name" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Origination_Spoof_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Spoofed_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Destination_Spoof_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Risk_Indicator_Status", + "Values": [ + { + "Value": "FAIL" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Risk_Indicator_Messages", + "Values": [ + { + "Value": "No First Seen Date associated to Phone #" + }, + { + "Value": "No Last Seen Date associated to Phone #" + }, + { + "Value": "No First Seen and Last Seen Date associated to Phone #" + }, + { + "Value": "Phone Service Type is Wireless" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Prepaid", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_Count", + "Values": [ + { + "Value": "1" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Ownership_at_Carrier_Indicators", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_Last_Year", + "Values": [ + { + "Value": "2022" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_Last_Month", + "Values": [ + { + "Value": "02" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_Last_Day", + "Values": [ + { + "Value": "01" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_Last_Status", + "Values": [ + { + "Value": "1" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Source_Counts", + "Values": [ + { + "Value": "1" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Self_Reported_Only", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_to_Phone_Sources", + "Values": [ + { + "Value": "WirelessPhoneContent" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Source_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Self_Reported_Only", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Port_Status", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_History_Statuses", + "Values": [ + { + "Value": "1" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_History_Year", + "Values": [ + { + "Value": "2022" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_History_Month", + "Values": [ + { + "Value": "02" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_History_Day", + "Values": [ + { + "Value": "01" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_OTP_Risk_Exceeded", + "Values": [ + { + "Value": "0" + } + ] + } + ] + } + ] +} diff --git a/spec/fixtures/proofing/lexis_nexis/phone_finder/rdp2_response.json b/spec/fixtures/proofing/lexis_nexis/phone_finder/rdp2_response.json new file mode 100644 index 00000000000..5e567fe4ee0 --- /dev/null +++ b/spec/fixtures/proofing/lexis_nexis/phone_finder/rdp2_response.json @@ -0,0 +1,594 @@ +{ + "Status": { + "ConversationId": "31000000000000", + "RequestId": "1000000", + "TransactionStatus": "passed" + }, + "Products": [ + { + "ProductType": "PhoneFinder", + "ExecutedStepName": "Execute_PhoneFinder", + "ProductConfigurationName": "", + "ProductStatus": "pass", + "Items": [ + { + "ItemName": "PrepaidPhoneNumber", + "ItemStatus": "pass" + }, + { + "ItemName": "LastChangeDateIMEI", + "ItemStatus": "pass" + }, + { + "ItemName": "NoContractCarrier", + "ItemStatus": "pass" + }, + { + "ItemName": "VOIPPhone", + "ItemStatus": "pass" + }, + { + "ItemName": "LastChangeDateIMSI", + "ItemStatus": "pass" + }, + { + "ItemName": "SurnameMismatch", + "ItemStatus": "pass" + }, + { + "ItemName": "LostStolen", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneReturnedOften", + "ItemStatus": "pass" + }, + { + "ItemName": "WirelessServiceType", + "ItemStatus": "fail", + "ItemReason": { + "Code": "WirelessServiceType.LOW", + "Description": "Phone Service Type is Wireless" + } + }, + { + "ItemName": "SourceSelfReported", + "ItemStatus": "pass" + }, + { + "ItemName": "LandlineServiceType", + "ItemStatus": "pass" + }, + { + "ItemName": "CableServiceType", + "ItemStatus": "pass" + }, + { + "ItemName": "1stFirstSeenDate", + "ItemStatus": "pass" + }, + { + "ItemName": "2ndFirstSeenDate", + "ItemStatus": "pass" + }, + { + "ItemName": "3rdFirstSeenDate", + "ItemStatus": "pass" + }, + { + "ItemName": "PhonePorted", + "ItemStatus": "pass" + }, + { + "ItemName": "FrequentlyPhonePorted", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneSpoofedNumOfDays", + "ItemStatus": "pass" + }, + { + "ItemName": "SpoofingPhoneNumber", + "ItemStatus": "pass" + }, + { + "ItemName": "SpoofingDestination", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneAssociatedWithMoreThanXIdentities", + "ItemStatus": "pass" + }, + { + "ItemName": "EmailCount(Month)", + "ItemStatus": "pass" + }, + { + "ItemName": "DeviceCount(Month)", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneHighCountryCount", + "ItemStatus": "pass" + }, + { + "ItemName": "RecentPhoneFirstSeen", + "ItemStatus": "pass" + }, + { + "ItemName": "DigitalIDBadReputation", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneNumberAssociatedWithFraud", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneInRejectedTransaction", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneSearch", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneOnGlobalBlacklist", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneOTPRequest", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneNotActive", + "ItemStatus": "pass" + }, + { + "ItemName": "SpoofedPhoneNumber", + "ItemStatus": "pass" + }, + { + "ItemName": "SubjectIsBusiness", + "ItemStatus": "pass" + }, + { + "ItemName": "PhoneForwarding", + "ItemStatus": "pass" + }, + { + "ItemName": "SubjectDeceased", + "ItemStatus": "pass" + }, + { + "ItemName": "NoFirstSeenDate", + "ItemStatus": "pass" + }, + { + "ItemName": "CommercialAddress", + "ItemStatus": "pass" + }, + { + "ItemName": "NoLastSeenDate", + "ItemStatus": "pass" + }, + { + "ItemName": "MismatchAreaCodeAndAddressArea", + "ItemStatus": "pass" + }, + { + "ItemName": "NoFirstAndLastSeenDate", + "ItemStatus": "pass" + }, + { + "ItemName": "NotCurrentAddress", + "ItemStatus": "pass" + }, + { + "ItemName": "LastSeenDateAge", + "ItemStatus": "pass" + } + ], + "ParameterDetails": [ + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_LexIDs", + "Values": [ + { + "Value": "1145063437" + }, + { + "Value": "0" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Deceased_Indicators", + "Values": [ + { + "Value": "N" + }, + { + "Value": "N" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Full_Names", + "Values": [ + { + "Value": "PII NAME" + }, + { + "Value": "PII NAME" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Street_1s", + "Values": [ + { + "Value": "123 PII ST" + }, + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Street_2s", + "Values": [ + { + "Value": "" + }, + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_StateCityZIPs", + "Values": [ + { + "Value": "PII, HI 55555" + }, + { + "Value": "PII, HI 55555" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Time_With_Phones", + "Values": [ + { + "Value": "36" + }, + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Time_Last_Seen_With_Phones", + "Values": [ + { + "Value": "4" + }, + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Address_Types", + "Values": [ + { + "Value": "Residential" + }, + { + "Value": "" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Address_Statuses", + "Values": [ + { + "Value": "" + }, + { + "Value": "" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Call_Forwarding_Indicator", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Number", + "Values": [ + { + "Value": "5555551212" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Type", + "Values": [ + { + "Value": "POSSIBLE WIRELESS" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Carrier", + "Values": [ + { + "Value": "PII COMPANY" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Listing_Name", + "Values": [ + { + "Value": "PII NAME" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Status", + "Values": [ + { + "Value": "ACTIVE" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Listing_Type", + "Values": [ + { + "Value": "RESIDENTIAL" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Address_Type", + "Values": [ + { + "Value": "" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Port_Code", + "Values": [ + { + "Value": "Not Ported" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Caller_ID", + "Values": [ + { + "Value": "PII NAME" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Port_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Phone_Verification_Indicator", + "Values": [ + { + "Value": "1" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_No_Contract_Carrier", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Operating_Company", + "Values": [ + { + "Value": "PII COMPANY" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Phone_Verification_Msg", + "Values": [ + { + "Value": "Input phone number matches last name" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Origination_Spoof_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Spoofed_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Destination_Spoof_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Risk_Indicator_Status", + "Values": [ + { + "Value": "WARN" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Risk_Indicator_Messages", + "Values": [ + { + "Value": "Phone Service Type is Wireless" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Prepaid", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Ownership_at_Carrier_Indicators", + "Values": [ + { + "Value": "0" + }, + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "OTP_Last_Status", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Source_Counts", + "Values": [ + { + "Value": "3" + }, + { + "Value": "1" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_Self_Reported_Only", + "Values": [ + { + "Value": "0" + }, + { + "Value": "0" + } + ] + }, + { + "Group": "IDENTITY_RECORDS", + "Name": "Consumer_to_Phone_Sources", + "Values": [ + { + "Value": "WirelessPhoneContent" + }, + { + "Value": "CreditInquiry" + }, + { + "Value": "LNRSInquiry" + }, + { + "Value": "WirelessPhoneContent" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Source_Count", + "Values": [ + { + "Value": "0" + } + ] + }, + { + "Group": "PRIMARY_PHONE", + "Name": "Primary_Phone_Self_Reported_Only", + "Values": [ + { + "Value": "0" + } + ] + } + ] + } + ] +} diff --git a/spec/services/proofing/lexis_nexis/phone_finder/proofing_spec.rb b/spec/services/proofing/lexis_nexis/phone_finder/proofing_spec.rb index fc53bf4ebbd..80bb7215be0 100644 --- a/spec/services/proofing/lexis_nexis/phone_finder/proofing_spec.rb +++ b/spec/services/proofing/lexis_nexis/phone_finder/proofing_spec.rb @@ -28,9 +28,19 @@ describe '#proof' do context 'when the response is a success' do - it 'is a successful result' do + it 'is a successful rdp1 result' do stub_request(:post, verification_request.url). - to_return(body: LexisNexisFixtures.phone_finder_success_response_json, status: 200) + to_return(body: LexisNexisFixtures.phone_finder_rdp1_success_response_json, status: 200) + + result = instance.proof(applicant) + + expect(result.success?).to eq(true) + expect(result.errors).to eq({}) + end + + it 'is a successful rdp2 result' do + stub_request(:post, verification_request.url). + to_return(body: LexisNexisFixtures.phone_finder_rdp2_success_response_json, status: 200) result = instance.proof(applicant) @@ -39,10 +49,10 @@ end end - context 'when the response is a failure' do + context 'when the rdp1 response is a failure' do it 'is a failure result' do stub_request(:post, verification_request.url). - to_return(body: LexisNexisFixtures.phone_finder_fail_response_json, status: 200) + to_return(body: LexisNexisFixtures.phone_finder_rdp1_fail_response_json, status: 200) result = instance.proof(applicant) @@ -56,6 +66,22 @@ end end + context 'when the rdp2 response is a failure' do + it 'is a failure result' do + stub_request(:post, verification_request.url). + to_return(body: LexisNexisFixtures.phone_finder_rdp2_fail_response_json, status: 200) + + result = instance.proof(applicant) + result_json_hash = result.errors[:PhoneFinder].first + + expect(result.success?).to eq(false) + expect(result_json_hash['ProductStatus']).to eq('fail') + expect(result_json_hash['Items'].class).to eq(Array) + # check that key contaning PII is removed and not logged + expect(result_json_hash['ParameterDetails']).to eq(nil) + end + end + context 'when the request times out' do it 'retuns a timeout result' do stub_request(:post, verification_request.url).to_timeout diff --git a/spec/services/proofing/lexis_nexis/phone_finder/verification_request_spec.rb b/spec/services/proofing/lexis_nexis/phone_finder/verification_request_spec.rb index bea0dca2be4..95e73649315 100644 --- a/spec/services/proofing/lexis_nexis/phone_finder/verification_request_spec.rb +++ b/spec/services/proofing/lexis_nexis/phone_finder/verification_request_spec.rb @@ -12,7 +12,7 @@ phone: '5551231234', } end - let(:response_body) { LexisNexisFixtures.phone_finder_success_response_json } + let(:response_body) { LexisNexisFixtures.phone_finder_rdp1_success_response_json } subject { described_class.new(applicant: applicant, config: LexisNexisFixtures.example_config) } it_behaves_like 'a lexisnexis request' diff --git a/spec/support/lexis_nexis_fixtures.rb b/spec/support/lexis_nexis_fixtures.rb index 574bb82a6c5..15d1355c593 100644 --- a/spec/support/lexis_nexis_fixtures.rb +++ b/spec/support/lexis_nexis_fixtures.rb @@ -89,13 +89,23 @@ def phone_finder_request_json JSON.parse(raw).to_json end - def phone_finder_success_response_json - raw = read_fixture_file_at_path('phone_finder/response.json') + def phone_finder_rdp1_success_response_json + raw = read_fixture_file_at_path('phone_finder/rdp1_response.json') JSON.parse(raw).to_json end - def phone_finder_fail_response_json - raw = read_fixture_file_at_path('phone_finder/fail_response.json') + def phone_finder_rdp2_success_response_json + raw = read_fixture_file_at_path('phone_finder/rdp2_response.json') + JSON.parse(raw).to_json + end + + def phone_finder_rdp1_fail_response_json + raw = read_fixture_file_at_path('phone_finder/rdp1_fail_response.json') + JSON.parse(raw).to_json + end + + def phone_finder_rdp2_fail_response_json + raw = read_fixture_file_at_path('phone_finder/rdp2_fail_response.json') JSON.parse(raw).to_json end