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 sum validation for BG number #34

Closed maffpool closed 5 years ago

maffpool commented 7 years ago

Hello

ValidatorBG does not validate this number BG204514061 which is vaidated by http://ec.europa.eu/taxation_customs/vies/vatRequest.html

DragonBe commented 7 years ago

Hey @maffpool, thanks for reporting this issue. I'm currently busy, but let me see if I can find some time this week to look into what caused the failure to validate and fix the issue.

I see it got validated through the original VIES service, so I assume there's a validation rule that's not working correctly. Should be easy to fix.

maffpool commented 7 years ago

Thanks @DragonBe for answering so quickly !

If you tell me where you find official information about checksums, maybe I could dig into this issue and submit a PR !?

DragonBe commented 7 years ago

Hey @maffpool,

We're basing the structure of a VAT ID on the documentation provided in the FAQ of the official VIES service website, but we have seen it's not always accurate or up-to-date.

Having users across the EU using this package will expose those undocumented changes (like you have reported), so we can just add it to our testcase and update our structure mask.

You can add your example VAT ID to the provider in tests/Vies/ValidatorTest.php and make it pass by updating the code of the validator src/Vies/Validator/ValidatorBG.php.

mato61 commented 5 years ago

Hi @DragonBe , I have problem with VAT ID BG8311046307. Result of validation is false. This VAT ID is validated by http://ec.europa.eu/taxation_customs/vies/vatRequest.html

I use version 2.1.5.

Thanks

DragonBe commented 5 years ago

Hey @mato61,

Thank you for reporting this issue. I've validated the issue through our unit tests and reopened the issue to fix it.

PHPUnit 7.5.0 by Sebastian Bergmann and contributors.

..............................F

Time: 1.69 seconds, Memory: 10.00MB

There was 1 failure:

1) DragonBe\Test\Vies\Validator\ValidatorBGTest::testValidator with data set #3 ('8311046307', true)
Failed asserting that false is identical to true.

/dev/dragonbe/vies/tests/Vies/Validator/AbstractValidatorTest.php:14
/dev/dragonbe/vies/tests/Vies/Validator/ValidatorBGTest.php:15

FAILURES!
Tests: 31, Assertions: 69, Failures: 1.

I won't be able to do any work on it until the beginning of February because of a full agenda. Maybe @krzaczek can have a look at it in the mean time? If not, I will look at this in February.

DragonBe commented 5 years ago

@mato61 I looked at it and the solution seemed simple enough to fix quickly so I did. I'll be releasing 2.1.6 now.