diff --git a/lib/identity_doc_auth/acuant/config.rb b/lib/identity_doc_auth/acuant/config.rb index f49dd54..d18b19a 100644 --- a/lib/identity_doc_auth/acuant/config.rb +++ b/lib/identity_doc_auth/acuant/config.rb @@ -14,6 +14,9 @@ module Acuant :facial_match_url, :passlive_url, :timeout, + :dpi_threshold, + :sharpness_threshold, + :glare_threshold, :exception_notifier, keyword_init: true, allowed_members: [ @@ -22,6 +25,9 @@ module Acuant :facial_match_url, :passlive_url, :timeout, + :dpi_threshold, + :sharpness_threshold, + :glare_threshold, ] ) end diff --git a/lib/identity_doc_auth/acuant/responses/get_results_response.rb b/lib/identity_doc_auth/acuant/responses/get_results_response.rb index ad4207a..cbac1aa 100644 --- a/lib/identity_doc_auth/acuant/responses/get_results_response.rb +++ b/lib/identity_doc_auth/acuant/responses/get_results_response.rb @@ -15,13 +15,13 @@ def initialize(http_response, config) @config = config super( success: successful_result?, - errors: error_messages_from_alerts, + errors: generate_errors, extra: { result: result_code.name, billed: result_code.billed, processed_alerts: processed_alerts, alert_failure_count: processed_alerts[:failed]&.count.to_i, - image_metrics: process_images_data, + image_metrics: processed_image_metrics, raw_alerts: raw_alerts, raw_regions: raw_regions, } @@ -31,7 +31,7 @@ def initialize(http_response, config) # Explicitly override #to_h here because this method response object contains PII. # This method is used to determine what from this response gets written to events.log. # #to_h is defined on the super class and should not include any parts of the response that - # contain PII. This method is here as a safegaurd in case that changes. + # contain PII. This method is here as a safeguard in case that changes. def to_h { success: success?, @@ -41,7 +41,7 @@ def to_h billed: result_code.billed, processed_alerts: processed_alerts, alert_failure_count: processed_alerts[:failed]&.count.to_i, - image_metrics: process_images_data, + image_metrics: processed_image_metrics, raw_alerts: raw_alerts, raw_regions: raw_regions, } @@ -62,6 +62,51 @@ def pii_from_doc attr_reader :http_response + def generate_errors + return {} if successful_result? + + dpi_threshold = config.dpi_threshold&.to_i || 290 + sharpness_threshold = config&.sharpness_threshold&.to_i || 40 + glare_threshold = config&.glare_threshold&.to_i || 40 + + front_dpi_fail, back_dpi_fail = false + front_sharp_fail, back_sharp_fail = false + front_glare_fail, back_glare_fail = false + + processed_image_metrics.each do |side, img_metrics| + hdpi = img_metrics['HorizontalResolution'] || 0 + vdpi = img_metrics['VerticalResolution'] || 0 + if hdpi < dpi_threshold || vdpi < dpi_threshold + front_dpi_fail = true if side == :front + back_dpi_fail = true if side == :back + end + + sharpness = img_metrics['SharpnessMetric'] + if sharpness.present? && sharpness < sharpness_threshold + front_sharp_fail = true if side == :front + back_sharp_fail = true if side == :back + end + + glare = img_metrics['GlareMetric'] + if glare.present? && glare < glare_threshold + front_glare_fail = true if side == :front + back_glare_fail = true if side == :back + end + end + + return { results: [Errors::DPI_LOW_BOTH_SIDES] } if front_dpi_fail && back_dpi_fail + return { results: [Errors::DPI_LOW_ONE_SIDE] } if front_dpi_fail || back_dpi_fail + + return { results: [Errors::SHARP_LOW_BOTH_SIDES] } if front_sharp_fail && back_sharp_fail + return { results: [Errors::SHARP_LOW_ONE_SIDE] } if front_sharp_fail || back_sharp_fail + + return { results: [Errors::GLARE_LOW_BOTH_SIDES] } if front_glare_fail && back_glare_fail + return { results: [Errors::GLARE_LOW_ONE_SIDE] } if front_glare_fail || back_glare_fail + + #if no image metric errors default to raw error output + error_messages_from_alerts + end + def error_messages_from_alerts return {} if successful_result? @@ -99,10 +144,10 @@ def processed_alerts @processed_alerts ||= process_raw_alerts(raw_alerts) end - def process_images_data - raw_images_data.index_by do |image| + def processed_image_metrics + @image_metrics ||= raw_images_data.index_by do |image| image.delete('Uri') - get_image_side_name(image['Side']).to_sym + get_image_side_name(image['Side']) end end @@ -127,7 +172,7 @@ def attention_with_barcode? end def get_image_side_name(side_number) - side_number == 0 ? 'front' : 'back' + side_number == 0 ? :front : :back end def get_image_info(image_id) diff --git a/lib/identity_doc_auth/errors.rb b/lib/identity_doc_auth/errors.rb new file mode 100644 index 0000000..11a2002 --- /dev/null +++ b/lib/identity_doc_auth/errors.rb @@ -0,0 +1,62 @@ +module IdentityDocAuth + module Errors + # Alerts + BARCODE_CONTENT_CHECK = 'barcode_content_check' + BARCODE_READ_CHECK = 'barcode_read_check' + BIRTH_DATE_CHECKS = 'birth_date_checks' + CONTROL_NUMBER_CHECK = 'control_number_check' + DOC_CROSSCHECK = 'doc_crosscheck' + DOC_NUMBER_CHECKS = 'doc_number_checks' + EXPIRATION_CHECKS = 'expiration_checks' + FULL_NAME_CHECK = 'full_name_check' + GENERAL_ERROR_LIVENESS = 'general_error_liveness' + GENERAL_ERROR_NO_LIVENESS = 'general_error_no_liveness' + ID_NOT_RECOGNIZED = 'id_not_recognized' + ID_NOT_VERIFIED = 'id_not_verified' + ISSUE_DATE_CHECKS = 'issue_date_checks' + MULTIPLE_BACK_ID_FAILURES = 'multiple_back_id_failures' + MULTIPLE_FRONT_ID_FAILURES = 'multiple_front_id_failures' + REF_CONTROL_NUMBER_CHECK = 'ref_control_number_check' + SELFIE_FAILURE = 'selfie_failure' + SEX_CHECK = 'sex_check' + VISIBLE_COLOR_CHECK = 'visible_color_check' + VISIBLE_PHOTO_CHECK = 'visible_photo_check' + # Image metrics + DPI_LOW_ONE_SIDE = 'dpi_low_one_side' + DPI_LOW_BOTH_SIDES = 'dpi_low_both_sides' + SHARP_LOW_ONE_SIDE = 'sharp_low_one_side' + SHARP_LOW_BOTH_SIDES = 'sharp_low_both_sides' + GLARE_LOW_ONE_SIDE = 'glare_low_one_side' + GLARE_LOW_BOTH_SIDES = 'glare_low_both_sides' + + ALL = [ + BARCODE_CONTENT_CHECK, + BARCODE_READ_CHECK, + BIRTH_DATE_CHECKS, + BIRTH_DATE_CHECKS, + CONTROL_NUMBER_CHECK, + DOC_CROSSCHECK, + DOC_NUMBER_CHECKS, + EXPIRATION_CHECKS, + FULL_NAME_CHECK, + GENERAL_ERROR_LIVENESS, + GENERAL_ERROR_NO_LIVENESS, + ID_NOT_RECOGNIZED, + ID_NOT_VERIFIED, + ISSUE_DATE_CHECKS, + MULTIPLE_BACK_ID_FAILURES, + MULTIPLE_FRONT_ID_FAILURES, + REF_CONTROL_NUMBER_CHECK, + SELFIE_FAILURE, + SEX_CHECK, + VISIBLE_COLOR_CHECK, + VISIBLE_PHOTO_CHECK, + DPI_LOW_ONE_SIDE, + DPI_LOW_BOTH_SIDES, + SHARP_LOW_ONE_SIDE, + SHARP_LOW_BOTH_SIDES, + GLARE_LOW_ONE_SIDE, + GLARE_LOW_BOTH_SIDES, + ].freeze + end +end diff --git a/lib/identity_doc_auth/lexis_nexis/error_generator.rb b/lib/identity_doc_auth/lexis_nexis/error_generator.rb index eae0c25..020c72f 100644 --- a/lib/identity_doc_auth/lexis_nexis/error_generator.rb +++ b/lib/identity_doc_auth/lexis_nexis/error_generator.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'identity_doc_auth/lexis_nexis/errors' +require 'identity_doc_auth/errors' module IdentityDocAuth module LexisNexis diff --git a/lib/identity_doc_auth/lexis_nexis/errors.rb b/lib/identity_doc_auth/lexis_nexis/errors.rb deleted file mode 100644 index 005a935..0000000 --- a/lib/identity_doc_auth/lexis_nexis/errors.rb +++ /dev/null @@ -1,50 +0,0 @@ -module IdentityDocAuth - module LexisNexis - module Errors - BARCODE_CONTENT_CHECK = 'barcode_content_check' - BARCODE_READ_CHECK = 'barcode_read_check' - BIRTH_DATE_CHECKS = 'birth_date_checks' - CONTROL_NUMBER_CHECK = 'control_number_check' - DOC_CROSSCHECK = 'doc_crosscheck' - DOC_NUMBER_CHECKS = 'doc_number_checks' - EXPIRATION_CHECKS = 'expiration_checks' - FULL_NAME_CHECK = 'full_name_check' - GENERAL_ERROR_LIVENESS = 'general_error_liveness' - GENERAL_ERROR_NO_LIVENESS = 'general_error_no_liveness' - ID_NOT_RECOGNIZED = 'id_not_recognized' - ID_NOT_VERIFIED = 'id_not_verified' - ISSUE_DATE_CHECKS = 'issue_date_checks' - MULTIPLE_BACK_ID_FAILURES = 'multiple_back_id_failures' - MULTIPLE_FRONT_ID_FAILURES = 'multiple_front_id_failures' - REF_CONTROL_NUMBER_CHECK = 'ref_control_number_check' - SELFIE_FAILURE = 'selfie_failure' - SEX_CHECK = 'sex_check' - VISIBLE_COLOR_CHECK = 'visible_color_check' - VISIBLE_PHOTO_CHECK = 'visible_photo_check' - - ALL = [ - BARCODE_CONTENT_CHECK, - BARCODE_READ_CHECK, - BIRTH_DATE_CHECKS, - BIRTH_DATE_CHECKS, - CONTROL_NUMBER_CHECK, - DOC_CROSSCHECK, - DOC_NUMBER_CHECKS, - EXPIRATION_CHECKS, - FULL_NAME_CHECK, - GENERAL_ERROR_LIVENESS, - GENERAL_ERROR_NO_LIVENESS, - ID_NOT_RECOGNIZED, - ID_NOT_VERIFIED, - ISSUE_DATE_CHECKS, - MULTIPLE_BACK_ID_FAILURES, - MULTIPLE_FRONT_ID_FAILURES, - REF_CONTROL_NUMBER_CHECK, - SELFIE_FAILURE, - SEX_CHECK, - VISIBLE_COLOR_CHECK, - VISIBLE_PHOTO_CHECK, - ].freeze - end - end -end diff --git a/lib/identity_doc_auth/version.rb b/lib/identity_doc_auth/version.rb index 6876f42..91a8885 100644 --- a/lib/identity_doc_auth/version.rb +++ b/lib/identity_doc_auth/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module IdentityDocAuth - VERSION = "0.5.0" + VERSION = "0.5.1" end diff --git a/spec/fixtures/acuant_responses/get_results_response_failure.json b/spec/fixtures/acuant_responses/get_results_response_failure.json index 03ff6ae..09fd627 100644 --- a/spec/fixtures/acuant_responses/get_results_response_failure.json +++ b/spec/fixtures/acuant_responses/get_results_response_failure.json @@ -175,30 +175,30 @@ "Fields": [], "Images": [ { - "GlareMetric": null, - "HorizontalResolution": 96, + "GlareMetric": 50, + "HorizontalResolution": 300, "Id": "fe7c612a-66bb-46ab-8b06-b28f657b6482", "IsCropped": false, "IsTampered": false, "Light": 0, "MimeType": "image/jpeg", - "SharpnessMetric": null, + "SharpnessMetric": 50, "Side": 0, "Uri": "https://services.assureid.net/AssureIDService/Document/97b0215a-7858-4104-b1f3-17dbaf609140/Image?side=Front&light=White", - "VerticalResolution": 96 + "VerticalResolution": 300 }, { - "GlareMetric": null, - "HorizontalResolution": 96, + "GlareMetric": 50, + "HorizontalResolution": 300, "Id": "60359af3-d87e-46da-ab5b-883ebfec923f", "IsCropped": false, "IsTampered": false, "Light": 0, "MimeType": "image/jpeg", - "SharpnessMetric": null, + "SharpnessMetric": 50, "Side": 1, "Uri": "https://services.assureid.net/AssureIDService/Document/97b0215a-7858-4104-b1f3-17dbaf609140/Image?side=Back&light=White", - "VerticalResolution": 96 + "VerticalResolution": 300 } ], "InstanceId": "97b0215a-7858-4104-b1f3-17dbaf609140", diff --git a/spec/identity_doc_auth/acuant/responses/get_results_response_spec.rb b/spec/identity_doc_auth/acuant/responses/get_results_response_spec.rb index 4636331..f367019 100644 --- a/spec/identity_doc_auth/acuant/responses/get_results_response_spec.rb +++ b/spec/identity_doc_auth/acuant/responses/get_results_response_spec.rb @@ -42,8 +42,8 @@ expected_alerts = { passed: a_collection_including( - a_hash_including(side: 'front', region: 'Flag Pattern'), - a_hash_including(side: 'front', region: 'Lower Data Labels Right') + a_hash_including(side: :front, region: 'Flag Pattern'), + a_hash_including(side: :front, region: 'Lower Data Labels Right') ) } @@ -113,6 +113,7 @@ ) end let(:raw_alerts) { JSON.parse(AcuantFixtures.get_results_response_success)['Alerts'] } + let(:parsed_response_body) { JSON.parse(AcuantFixtures.get_results_response_failure) } it 'returns an unsuccessful response with errors' do expect(response.success?).to eq(false) @@ -127,7 +128,6 @@ context 'when with an acuant error message' do let(:http_response) do - parsed_response_body = JSON.parse(AcuantFixtures.get_results_response_failure) parsed_response_body['Alerts'].first['Disposition'] = 'This message does not have a key' instance_double( Faraday::Response, @@ -146,7 +146,6 @@ context 'when multiple alerts have the same friendly error' do let(:http_response) do - parsed_response_body = JSON.parse(AcuantFixtures.get_results_response_failure) parsed_response_body['Alerts'].first['Disposition'] = 'This message does not have a key' parsed_response_body['Alerts'][1] = parsed_response_body['Alerts'].first instance_double( @@ -187,5 +186,270 @@ expect(response.exception).to be_nil end end + + context 'when front image HDPI is too low' do + let(:http_response) do + parsed_response_body['Images'].first['HorizontalResolution'] = 250 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with front DPI error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::DPI_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when front image VDPI is too low' do + let(:http_response) do + parsed_response_body['Images'].first['VerticalResolution'] = 250 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with front DPI error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::DPI_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when back image HDPI is too low' do + let(:http_response) do + parsed_response_body['Images'][1]['HorizontalResolution'] = 250 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with back DPI error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::DPI_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when back image VDPI is too low' do + let(:http_response) do + parsed_response_body['Images'][1]['VerticalResolution'] = 250 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with back DPI error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::DPI_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when front and back image DPI is too low' do + let(:http_response) do + parsed_response_body['Images'][0]['HorizontalResolution'] = 250 + parsed_response_body['Images'][1]['VerticalResolution'] = 250 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with both DPI error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::DPI_LOW_BOTH_SIDES], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when front image sharpness is too low' do + let(:http_response) do + parsed_response_body['Images'][0]['SharpnessMetric'] = 25 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with front sharpness error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::SHARP_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when back image sharpness is too low' do + let(:http_response) do + parsed_response_body['Images'][1]['SharpnessMetric'] = 25 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with back sharpness error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::SHARP_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when both images sharpness is too low' do + let(:http_response) do + parsed_response_body['Images'][0]['SharpnessMetric'] = 25 + parsed_response_body['Images'][1]['SharpnessMetric'] = 25 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with both sharpness error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::SHARP_LOW_BOTH_SIDES], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when a sharpness metric is missing' do + let(:http_response) do + parsed_response_body['Images'][0].delete('SharpnessMetric') + parsed_response_body['Images'][1]['SharpnessMetric'] = 25 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with single sharpness error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::SHARP_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when front image glare is too low' do + let(:http_response) do + parsed_response_body['Images'][0]['GlareMetric'] = 25 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with front glare error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::GLARE_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when back image glare is too low' do + let(:http_response) do + parsed_response_body['Images'][1]['GlareMetric'] = 25 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with back glare error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::GLARE_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when both images glare is too low' do + let(:http_response) do + parsed_response_body['Images'][0]['GlareMetric'] = 25 + parsed_response_body['Images'][1]['GlareMetric'] = 25 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with both glare error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::GLARE_LOW_BOTH_SIDES], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end + + context 'when a glare metric is missing' do + let(:http_response) do + parsed_response_body['Images'][0].delete('GlareMetric') + parsed_response_body['Images'][1]['GlareMetric'] = 25 + instance_double( + Faraday::Response, + body: parsed_response_body.to_json, + ) + end + + it 'returns an unsuccessful response with single glare error' do + expect(response.success?).to eq(false) + expect(response.errors).to eq( + results: [IdentityDocAuth::Errors::GLARE_LOW_ONE_SIDE], + ) + expect(response.exception).to be_nil + expect(response.result_code).to eq(IdentityDocAuth::Acuant::ResultCodes::UNKNOWN) + expect(response.result_code.billed?).to eq(false) + end + end end end diff --git a/spec/identity_doc_auth/lexis_nexis/error_generator_spec.rb b/spec/identity_doc_auth/lexis_nexis/error_generator_spec.rb index c5e9f34..ef037b5 100644 --- a/spec/identity_doc_auth/lexis_nexis/error_generator_spec.rb +++ b/spec/identity_doc_auth/lexis_nexis/error_generator_spec.rb @@ -39,7 +39,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:back) expect(output[:back]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::BARCODE_READ_CHECK, + IdentityDocAuth::Errors::BARCODE_READ_CHECK, ) end @@ -53,7 +53,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:id) expect(output[:id]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::ID_NOT_VERIFIED, + IdentityDocAuth::Errors::ID_NOT_VERIFIED, ) end @@ -70,7 +70,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:general) expect(output[:general]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::GENERAL_ERROR_NO_LIVENESS, + IdentityDocAuth::Errors::GENERAL_ERROR_NO_LIVENESS, ) end @@ -87,7 +87,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:id) expect(output[:id]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::GENERAL_ERROR_NO_LIVENESS, + IdentityDocAuth::Errors::GENERAL_ERROR_NO_LIVENESS, ) end @@ -104,7 +104,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:back) expect(output[:back]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::MULTIPLE_BACK_ID_FAILURES, + IdentityDocAuth::Errors::MULTIPLE_BACK_ID_FAILURES, ) end @@ -121,7 +121,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:general) expect(output[:general]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::GENERAL_ERROR_NO_LIVENESS, + IdentityDocAuth::Errors::GENERAL_ERROR_NO_LIVENESS, ) end @@ -141,7 +141,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:id) expect(output[:id]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::BIRTH_DATE_CHECKS, + IdentityDocAuth::Errors::BIRTH_DATE_CHECKS, ) end @@ -159,7 +159,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:id) expect(output[:id]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::BIRTH_DATE_CHECKS, + IdentityDocAuth::Errors::BIRTH_DATE_CHECKS, ) end end @@ -176,7 +176,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:back) expect(output[:back]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::BARCODE_READ_CHECK, + IdentityDocAuth::Errors::BARCODE_READ_CHECK, ) end @@ -191,7 +191,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:general) expect(output[:general]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::GENERAL_ERROR_LIVENESS, + IdentityDocAuth::Errors::GENERAL_ERROR_LIVENESS, ) end @@ -206,7 +206,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:back) expect(output[:back]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::BARCODE_READ_CHECK, + IdentityDocAuth::Errors::BARCODE_READ_CHECK, ) end @@ -217,7 +217,7 @@ def build_error_info(doc_result: nil, liveness_result: nil, passed: [], failed: expect(output.keys).to contain_exactly(:selfie) expect(output[:selfie]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::SELFIE_FAILURE, + IdentityDocAuth::Errors::SELFIE_FAILURE, ) end end diff --git a/spec/identity_doc_auth/lexis_nexis/responses/true_id_response_spec.rb b/spec/identity_doc_auth/lexis_nexis/responses/true_id_response_spec.rb index 9bbcff9..a808850 100644 --- a/spec/identity_doc_auth/lexis_nexis/responses/true_id_response_spec.rb +++ b/spec/identity_doc_auth/lexis_nexis/responses/true_id_response_spec.rb @@ -74,7 +74,7 @@ expect(output[:success]).to eq(false) expect(errors.keys).to contain_exactly(:general) expect(errors[:general]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::GENERAL_ERROR_NO_LIVENESS, + IdentityDocAuth::Errors::GENERAL_ERROR_NO_LIVENESS, ) end @@ -85,7 +85,7 @@ expect(output[:success]).to eq(false) expect(errors.keys).to contain_exactly(:general) expect(errors[:general]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::GENERAL_ERROR_LIVENESS, + IdentityDocAuth::Errors::GENERAL_ERROR_LIVENESS, ) end @@ -96,7 +96,7 @@ expect(output[:success]).to eq(false) expect(errors.keys).to contain_exactly(:general) expect(errors[:general]).to contain_exactly( - IdentityDocAuth::LexisNexis::Errors::GENERAL_ERROR_LIVENESS, + IdentityDocAuth::Errors::GENERAL_ERROR_LIVENESS, ) end end