-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grece is using custom country code EL instead of the international code GR #57
Comments
Thank you @johanwilfer for mentioning this. We have noticed the difference in the VAT prefix and the international country code, but as all things from the European Commission, exceptions on the rule must exist. I agree that this exception should be documented in the code to make it clear for developers and integrators why this exception exists, maybe even add this as a separate remark in the Just for my understanding: this VIES library processes the Greece VAT IDN's correctly, right? It's just that the prefix EL is different from the international ISO code for Greece, being GR. Correct? Just to verify, I've added the Greece railway company Train OSE SA in my example, returning valid information after validation: Valid
Identifier: WAPIAAAAWcNVzowR
Date and time: 13/11/2018 01:00
Company name: ΤΡΑΙΝΟΣΕ ΜΕΤΑΦΟΡΕΣ ΜΕΤΑΦΟΡΙΚΕΣ ΥΠΗΡΕΣΙΕΣ ΕΠΙΒΑΤΩΝ ΚΑΙ ΦΟΡΤΙΟΥ ΑΝΩΝΥΜΗ ΣΙΔΗΡΟΔΡΟΜΙΚΗ ΕΤΑΙΡΕΙΑ ||ΤΡΑΙΝΟΣΕ ΑΕ
Company address: ΚΑΡΟΛΟΥ 1-3 10437 - ΑΘΗΝΑ |
Yes, the validation works great. I just tested this also. Thanks for updating the README about this. :-) |
@johanwilfer You're very welcome. Only with this kind of feedback I can make the information more meaningful for users, especially when you're not engaging with VAT related things on a regular basis. The more I receive this type of not expected behaviour, the better use cases I can come up with and more accurate we can make our pre-validation before we fire things of to the EC VIES service. |
Old but still GR <-> EL As i read: GR is a country iso,
We may should change that in next major release to GR Every method should look up the vat prefix in the array instead using the country iso. Example:
Should then look like
TODO: does VIES expect the VAT prefix, or the real country iso? |
The two-letter country code for Greece is GR, but in VAT id's in Europe Greece uses the EL-prefix instead.
https://en.wikipedia.org/wiki/ISO_3166-2:GR
In our code we used this list to compare to the international country codes and because GR != EL this obviously failed: https://github.com/DragonBe/vies/blob/master/src/Vies/Vies.php#L63
We will now take the list from listEuropeanCountries and make sure we convert this, but opening this here as a note. Maybe we should note the exception in a comment in this method, or note that EL is not the international code for Greece, they just use that as a VAT prefix. So in a sense the method name is misleading...
Thanks for a great library!
The text was updated successfully, but these errors were encountered: