diff --git a/modules/claims_api/lib/bgs_service/vnp_proc_service_v2.rb b/modules/claims_api/lib/bgs_service/vnp_proc_service_v2.rb new file mode 100644 index 00000000000..e4d9eb48b36 --- /dev/null +++ b/modules/claims_api/lib/bgs_service/vnp_proc_service_v2.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module ClaimsApi + class VnpProcServiceV2 < ClaimsApi::LocalBGS + PROC_TYPE_CD = 'POAAUTHZ' + + def vnp_proc_create + body = Nokogiri::XML::DocumentFragment.parse <<~EOXML + + + #{PROC_TYPE_CD} + + + EOXML + + make_request(endpoint: 'VnpProcWebServiceBeanV2/VnpProcServiceV2', action: 'vnpProcCreate', body:, key: 'return') + end + end +end diff --git a/modules/claims_api/spec/lib/claims_api/vnp_proc_service_v2_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_proc_service_v2_spec.rb new file mode 100644 index 00000000000..71ed08a3c15 --- /dev/null +++ b/modules/claims_api/spec/lib/claims_api/vnp_proc_service_v2_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'bgs_service/vnp_proc_service_v2' + +describe ClaimsApi::VnpProcServiceV2 do + subject { described_class.new external_uid: 'xUid', external_key: 'xKey' } + + describe 'vnp_proc_create' do + it 'responds with a vnp_proc_id' do + VCR.use_cassette('bgs/vnp_proc_service_v2/vnp_proc_create') do + result = subject.vnp_proc_create + expect(result[:vnp_proc_id]).to eq '29637' + end + end + end +end diff --git a/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_create.yml b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_create.yml new file mode 100644 index 00000000000..3a4be9d2d32 --- /dev/null +++ b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_create.yml @@ -0,0 +1,247 @@ +--- +http_interactions: +- request: + method: get + uri: https://internal-dsva-vagov-dev-fwdproxy-1893365470.us-gov-west-1.elb.amazonaws.com:4447/VnpProcWebServiceBeanV2/VnpProcServiceV2?WSDL + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v2.9.0 + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 25 Mar 2024 16:05:36 GMT + Server: + - Apache + X-Frame-Options: + - SAMEORIGIN + Transfer-Encoding: + - chunked + Content-Type: + - text/xml;charset=utf-8 + Strict-Transport-Security: + - max-age=16000000; includeSubDomains; preload; + body: + encoding: UTF-8 + string: |- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + recorded_at: Mon, 25 Mar 2024 16:05:36 GMT +- request: + method: post + uri: https://internal-dsva-vagov-dev-fwdproxy-1893365470.us-gov-west-1.elb.amazonaws.com:4447/VnpProcWebServiceBeanV2/VnpProcServiceV2 + body: + encoding: UTF-8 + string: | + + + + + + VAgovAPI + + + 192.168.0.252 + 281 + VAgovAPI + xUid + xKey + + + + + + + + + POAAUTHZ + + + + + + + headers: + User-Agent: + - Faraday v2.9.0 + Content-Type: + - text/xml;charset=UTF-8 + Host: + - ".vba.va.gov" + Soapaction: + - '"vnpProcCreate"' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 25 Mar 2024 16:05:37 GMT + Server: + - Apache + X-Frame-Options: + - SAMEORIGIN + X-Oracle-Dms-Ecid: + - 756dd60b-d519-43cb-a39c-ac73ec3b9906-0000009e + X-Oracle-Dms-Rid: + - '0' + Transfer-Encoding: + - chunked + Content-Type: + - text/xml; charset=utf-8 + Strict-Transport-Security: + - max-age=16000000; includeSubDomains; preload; + body: + encoding: UTF-8 + string: rO0ABXdKABR3ZWJsb2dpYy5hcHAudm5wLWVhcgAAANYAAAAjd2VibG9naWMud29ya2FyZWEuU3RyaW5nV29ya0NvbnRleHQABTIuMC44AAA=29637 + recorded_at: Mon, 25 Mar 2024 16:05:38 GMT +recorded_with: VCR 6.2.0