Class: Valvat::Lookup::VIES
Constant Summary collapse
- ENDPOINT_URI =
URI('https://ec.europa.eu/taxation_customs/vies/services/checkVatService').freeze
- HEADERS =
{ 'Accept' => 'text/xml;charset=UTF-8', 'Content-Type' => 'text/xml;charset=UTF-8', 'SOAPAction' => '' }.freeze
- BODY =
" <soapenv:Envelope\n xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n xmlns:urn=\"urn:ec.europa.eu:taxud:vies:services:checkVat:types\">\n <soapenv:Header/>\n <soapenv:Body>\n <urn:checkVat<%= 'Approx' if @requester %>>\n <urn:countryCode><%= @vat.vat_country_code %></urn:countryCode>\n <urn:vatNumber><%= @vat.to_s_wo_country %></urn:vatNumber>\n <% if @requester %>\n <urn:requesterCountryCode><%= @requester.vat_country_code %></urn:requesterCountryCode>\n <urn:requesterVatNumber><%= @requester.to_s_wo_country %></urn:requesterVatNumber>\n <% end %>\n </urn:checkVat<%= 'Approx' if @requester %>>\n </soapenv:Body>\n </soapenv:Envelope>\n".gsub(/^\s+/, '')
- BODY_TEMPLATE =
ERB.new(BODY).freeze
Method Summary
Methods inherited from Base
Constructor Details
This class inherits a constructor from Valvat::Lookup::Base