Dear Bart,
Thanks a lot for your report and your submission.
I
uploaded the fixed version to CPAN, it should be available very soon.
Please note that the regexp matching the "Yes, valid VAT number"
response was also broken, so that I fixed it too.
Have a nice evening
!
Best regards,
Bernard
On Wed, 29 Feb 2012 06:22:42 -0500, Bart
Heupers via RT wrote:
Show quoted text> Wed Feb 29 06:22:41 2012: Request 75405 was
acted upon.
Show quoted text> Transaction: Ticket created by bheupers
> Queue:
Business-Tax-VAT-Validation
Show quoted text> Subject: VAT validation does not seem to
work anymore
Show quoted text> Broken in: 0.22
> Severity: Critical
> Owner: Nobody
>
Requestors: bart.heupers@xs4all.nl [1]
Show quoted text> Status: new
> Ticket
https://rt.cpan.org/Ticket/Display.html?id=75405 >
Show quoted text>
> The VAT
validation did not seem to work any more, probably because the
Show quoted text> VIES
website changed formatting.
Show quoted text>
> In our local version I have fixed by
changing _is_res_ok with :
Show quoted text>
> sub _is_res_ok {
> my($self,$res)=@_;
>
if ($res=~/^(d{3}) (.*)/) {
Show quoted text> return $self->_set_error(, )
> }
> if
($res =~ />s*No, invalid VAT number/m) {
Show quoted text> return $self->_set_error(2,
"This VAT number doesn't exists in
Show quoted text> EU database.")
> } elsif ($res =~
/>s*Error: (.*)$/im) {
Show quoted text> return $self->_set_error(3, "This VAT number
contains errors: ".)
Show quoted text> } elsif ($res =~ /Request time-out. Please
re-submit your request
Show quoted text> later/m){
> return $self->_set_error(17, "Time
out connecting to the database")
Show quoted text> } elsif ($res =~ />s*Member State
service unavailable/m) {
Show quoted text> return $self->_set_error(18, "Member State
service unavailable:
Show quoted text> Please re-submit your request later.")
> } elsif
($res =~ />s*(System busy: Too many requests). (Please
Show quoted text> re-submit your
request later.)/m) {
Show quoted text> return $self->_set_error(19, ": ")
> }
> return 1
if $res =~ />s*Yes, valid VAT numbers*$/m;
Show quoted text> $self->_set_error(257,
"Invalid response, please contact the author
Show quoted text> of this module. ".$res)
>
}
Show quoted text>
> The complete fixed module is attached.
--
Bernard
Nauwelaerts
IT Development
Gorges du Loup, 5
B4877 Olne Belgium
Mobile:
+32 477 433 884
E-Mail: bpn@it-development.be
NOTICE
This email was
sent from within the Belgian company IT Development.
This email (and any
attachments or hyperlinks within it) may contain
information that is
confidential, legally privileged or otherwise protected from
disclosure.
If you are not the intended recipient of this email, you are
not entitled to use, disclose, distribute, copy, print, disseminate or
rely on this email in any way. If you have received this email in error,
please notify the sender immediately by telephone or email and destroy
it, and all copies of it.
We have taken steps to ensure that this email
(and any attachments) are free of computer viruses and the like.
However, it is the recipient's responsibility to ensure that it is
actually virus free. Any emails that you send to us may be monitored for
the purposes of ascertaining whether the communication complies with the
law and our policies.
Links:
------
[1]
mailto:bart.heupers@xs4all.nl