DragonBe / vies

Component using the European Commission (EC) VAT Information Exchange System (VIES) to verify and validate VAT registration numbers in the EU, using PHP and Composer.
http://ec.europa.eu/taxation_customs/vies/faqvies.do#item16
MIT License
266 stars 59 forks source link

Invalid VAT number doesn't mean that it's not real ;-) #38

Closed michalsingr closed 7 years ago

michalsingr commented 7 years ago

https://github.com/DragonBe/vies/blob/c367d119bac21d921a9f5f06e479f82f4183ce6c/src/Vies/Vies.php#L222

This condition might be tricky... As my second test I've tried VAT CZ27082440 (the biggest e-shop in our country) which was evaluated by validateVatSum() method as invalid but it's existing and can be properly checked via VIES website.

I understand that the purpose of this is probably reducing requests to VEIS but IMHO I would not trust any EU administrator that a pattern (probably defined by law) for VAT number was fulfilled. As a result of this condition we get faked data, not real data from VIES.

Removing this condition or making it optional would help.

krzaczek commented 7 years ago

@michalsingr Just pushed a patch to fix this issue. Maybe it's a good idea to add a switch that would allow to disable check-sum checking and relay 100% on the VIES API.

@DragonBe