If your system is located behind a proxy :
$hvatn=Business::Tax::VAT::Validation->new(-proxy => ['http', 'http://example.com:8001/']);
Note : See LWP::UserAgent for proxy options.
my $err = $hvatn->get_last_error_code();
my $txt = $hvatn->get_last_error();
Possible errors are :
-1 The provided VAT number is valid.
0 Unknown MS code : Internal checkup failed (Specified Member State does not exist)
1 Invalid VAT number format : Internal checkup failed (bad syntax)
2 This VAT number doesn't exist in EU database : distant checkup
3 This VAT number contains errors : distant checkup
17 Time out connecting to the database : Temporary error when the connection to the database times out
18 Member Sevice Unavailable: The EU database is unable to reach the requested member's database.
19 The EU database is too busy.
20 Connexion to the VIES database failed.
21 The VIES interface failed to parse a stream. This error occurs unpredictabely, so you should retry your validation request.
257 Invalid response, please contact the author of this module. : This normally only happens if this software doesn't recognize any valid pattern into the response document: this generally means that the database interface has been modified, and you'll make the author happy by submitting the returned response !!!
500 The VIES server encountered an internal server error. Error 500 : soap:Server TIMEOUT Error 500 : soap:Server MS_UNAVAILABLE
If error_code > 16, you should temporarily accept the provided number, and periodically perform new checks until response is OK or error < 17 If error_code > 256, you should temporarily accept the provided number, contact the author, and perform a new check when the software is updated.
Many thanks to the following people, actively involved in the development of this software by submitting patches, bug reports, new members regexps, VIES interface changes,... (sorted by last intervention) :
Gregor Herrmann, Debian.
Bart Heupers, Netherlands.
Martin H. Sluka, noris network AG, Germany.
Simon Williams, UK2 Limited, United Kingdom & Benoît Galy, Greenacres, France & Raluca Boboia, Evozon, Romania