diff --git a/app/services/proofing/aamva/request/templates/verify.xml.erb b/app/services/proofing/aamva/request/templates/verify.xml.erb index c9ab21d99b6..d2f71e6b7e5 100644 --- a/app/services/proofing/aamva/request/templates/verify.xml.erb +++ b/app/services/proofing/aamva/request/templates/verify.xml.erb @@ -1,37 +1,41 @@ - + http://aamva.org/dldv/wsdl/2.1/IDLDVService21/VerifyDriverLicenseData - - + + <%= auth_token %> - - - - - + + + + + <%= transaction_locator_id %> - - GSA - - - - - - - - - - - - - - - - - - - + + GSA + + + + + + + + + + + + + + + + + + + diff --git a/app/services/proofing/aamva/request/verification_request.rb b/app/services/proofing/aamva/request/verification_request.rb index 69e45d65dd8..ecff76af4a4 100644 --- a/app/services/proofing/aamva/request/verification_request.rb +++ b/app/services/proofing/aamva/request/verification_request.rb @@ -64,24 +64,24 @@ def add_user_provided_data_to_body end add_optional_element( - 'ns2:AddressDeliveryPointText', + 'nc:AddressDeliveryPointText', value: applicant.address2, document:, - after: '//ns1:Address/ns2:AddressDeliveryPointText', + after: '//aa:Address/nc:AddressDeliveryPointText', ) add_optional_element( - 'ns2:DriverLicenseIssueDate', + 'aa:DriverLicenseIssueDate', value: applicant.state_id_data.state_id_issued, document:, - inside: '//ns:verifyDriverLicenseDataRequest', + inside: '//dldv:verifyDriverLicenseDataRequest', ) add_optional_element( - 'ns2:DriverLicenseExpirationDate', + 'aa:DriverLicenseExpirationDate', value: applicant.state_id_data.state_id_expiration, document:, - inside: '//ns:verifyDriverLicenseDataRequest', + inside: '//dldv:verifyDriverLicenseDataRequest', ) @body = document.to_s @@ -142,15 +142,15 @@ def transaction_locator_id def user_provided_data_map { - '//ns2:IdentificationID' => state_id_number, - '//ns1:MessageDestinationId' => message_destination_id, - '//ns2:PersonGivenName' => applicant.first_name, - '//ns2:PersonSurName' => applicant.last_name, - '//ns1:PersonBirthDate' => applicant.dob, - '//ns2:AddressDeliveryPointText' => applicant.address1, - '//ns2:LocationCityName' => applicant.city, - '//ns2:LocationStateUsPostalServiceCode' => applicant.state, - '//ns2:LocationPostalCode' => applicant.zipcode, + '//nc:IdentificationID' => state_id_number, + '//aa:MessageDestinationId' => message_destination_id, + '//nc:PersonGivenName' => applicant.first_name, + '//nc:PersonSurName' => applicant.last_name, + '//aa:PersonBirthDate' => applicant.dob, + '//nc:AddressDeliveryPointText' => applicant.address1, + '//nc:LocationCityName' => applicant.city, + '//nc:LocationStateUsPostalServiceCode' => applicant.state, + '//nc:LocationPostalCode' => applicant.zipcode, } end diff --git a/spec/fixtures/proofing/aamva/requests/verification_request.xml b/spec/fixtures/proofing/aamva/requests/verification_request.xml index 3e6068d01db..8321a8aba2c 100644 --- a/spec/fixtures/proofing/aamva/requests/verification_request.xml +++ b/spec/fixtures/proofing/aamva/requests/verification_request.xml @@ -1,37 +1,37 @@ - + http://aamva.org/dldv/wsdl/2.1/IDLDVService21/VerifyDriverLicenseData - - + + KEYKEYKEY - - - - - + + + + + 1234-abcd-efgh - - GSA - CA - - - - 123456789 - - 1942-10-29 - - Testy - McTesterson - - - 123 Sunnyside way - Sterling - VA - 20176 - - - + + GSA + CA + + + + 123456789 + + 1942-10-29 + + Testy + McTesterson + + + 123 Sunnyside way + Sterling + VA + 20176 + + + diff --git a/spec/lib/aamva_test_spec.rb b/spec/lib/aamva_test_spec.rb index e490bd113ba..4a6e5e399ba 100644 --- a/spec/lib/aamva_test_spec.rb +++ b/spec/lib/aamva_test_spec.rb @@ -43,7 +43,7 @@ expect(WebMock).to( have_requested(:post, verification_url).with do |req| - expect(Nokogiri::XML(req.body).at_xpath('//ns1:MessageDestinationId').text). + expect(Nokogiri::XML(req.body).at_xpath('//aa:MessageDestinationId').text). to eq('P6'), 'it sends a request with the designated fake state' end, ) diff --git a/spec/services/proofing/aamva/request/verification_request_spec.rb b/spec/services/proofing/aamva/request/verification_request_spec.rb index 19279b21218..14de5da2a5d 100644 --- a/spec/services/proofing/aamva/request/verification_request_spec.rb +++ b/spec/services/proofing/aamva/request/verification_request_spec.rb @@ -47,7 +47,10 @@ applicant.address2 = 'Apt 1' document = REXML::Document.new(subject.body) - address_node = REXML::XPath.first(document, '//ns:verifyDriverLicenseDataRequest/ns1:Address') + address_node = REXML::XPath.first( + document, + '//dldv:verifyDriverLicenseDataRequest/aa:Address', + ) address_node_element_names = address_node.elements.map(&:name) address_node_element_values = address_node.elements.map(&:text) @@ -75,14 +78,14 @@ it 'includes issue date if present' do applicant.state_id_data.state_id_issued = '2024-05-06' expect(subject.body).to include( - '2024-05-06', + '2024-05-06', ) end it 'includes expiration date if present' do applicant.state_id_data.state_id_expiration = '2030-01-02' expect(subject.body).to include( - '2030-01-02', + '2030-01-02', ) end end @@ -156,7 +159,7 @@ let(:state_id_jurisdiction) { 'SC' } let(:rendered_state_id_number) do body = REXML::Document.new(subject.body) - REXML::XPath.first(body, '//ns2:IdentificationID')&.text + REXML::XPath.first(body, '//nc:IdentificationID')&.text end context 'id is greater than 8 digits' do diff --git a/spec/services/proofing/aamva/verification_client_spec.rb b/spec/services/proofing/aamva/verification_client_spec.rb index 9638d4d7fd9..dc0f0b9d3c5 100644 --- a/spec/services/proofing/aamva/verification_client_spec.rb +++ b/spec/services/proofing/aamva/verification_client_spec.rb @@ -25,7 +25,7 @@ verification_stub = stub_request(:post, AamvaFixtures.example_config.verification_url). to_return(body: AamvaFixtures.verification_response, status: 200). with do |request| - xml_text_at_path(request.body, '//ns:token').gsub(/\s/, '') == 'ThisIsTheToken' + xml_text_at_path(request.body, '//dldv:token').gsub(/\s/, '') == 'ThisIsTheToken' end verification_client.send_verification_request(