Jump to content

EU VAT validation doesn't work anymore

Go to solution Solved by opentype,

Recommended Posts

Hi team,

The Nexus VAT validation for EU business addresses seems to not work any longer.

In \Tax::validateVAT at line 382:

		if ( $xml->read() )
			if ( $xml->name === 'soap:Envelope' and $xml->read() )
				if ( $xml->name === 'soap:Body' and $xml->read() )
					if ( $xml->name === 'checkVatResponse' )
							$responseArray[ $xml->name ] = $xml->readString();
						while ( $xml->next() and $xml->nodeType !== $xml::END_ELEMENT );


The response from the EU service seems to have changed; the XML looks something like that:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <ns2:checkVatResponse xmlns:ns2="urn:ec.europa.eu:taxud:vies:services:checkVat:types">

➡️ The namespace is "env", and a <env:Header> tag seems to have appeared before the Body; so the $xml->read() can't find the Body element any longer.


Thank you!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...