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

Remove support for the United Kingdom ("GB") #126

Closed jonathanmaron closed 3 years ago

jonathanmaron commented 3 years ago

On 31 December 2020, the transition period for the United Kingdom's withdrawal from the EU ended. This means that the UK is now formally a third country and EU law no longer applies there.

For the purposes of customs, the UK is treated as any other non-EU country as of 1 January 2021. In particular, customs procedures and formalities now apply to trade between the UK and the EU.

Source: https://ec.europa.eu/taxation_customs/uk_withdrawal_en

We therefore should remove support for the United Kingdom.

DragonBe commented 3 years ago

As mentioned in #127 I would like to implement the Nothern Ireland structures first before removing the UK completely from this library.

DragonBe commented 3 years ago

Question: is removing support of the UK a BC break for which I need to release a new major version 3.0.0, or do I accept it as normal progression and tag it as a 2.2.0 or a 2.1.15 release?

jonathanmaron commented 3 years ago

Since we are removing a class, that is absolutely a breaking change and requires a new major version.

Increment the [..] MAJOR version when you make incompatible API changes.

Source: https://semver.org/

Removing a class is an "incompatible API change".

DragonBe commented 3 years ago

@jonathanmaron that's exactly what I was thinking too, but bear with me when I play devil's advocate.

Keeping UK in the current code base can be considered a bug since Brexit and has to be fixed. The validation routines are not impacted nor is there a change in API signatures, the only thing that happens is a removal of a configuration that now allows validation of Brittish VAT ID's and with them helper classes that allow the validation to be executed.

In the above thinking the change looks more like a bugfix rather than a BC breaking version.

If I tag this as version a new major release, people who are using the older version are still validating UK VAT ID's locally, but fail validation at the EC VIES service which is not a desired feature. This is where I'm stuck.

DragonBe commented 3 years ago

Added Polls on

michaelcullum commented 3 years ago

I'd say it's major, as VAT is still applicable inside the UK same as before (if you're a UK entity using this would be a significant breaking change), and VAT is still to be paid on products purchased & being imported to the UK from the EU.

I'd say the ideal would be introducing an extra option that would make the UK fail, thereby giving users the option for if they see it as a bug for their use-case, they can implement a change as appropriate, but does not introduce a BC break for people expecting current behaviour.

DragonBe commented 3 years ago

Instead of removing support for the UK, we could continue to support all users there by providing an additional call to the service provided by Gov.uk as suggested by Derick. This service is still in beta though.

cooperaj commented 3 years ago

I work for a gov agency with public facing sites. Beta may mean changes in the future but (by our standards at least) would mean the service is here to stay.

DragonBe commented 3 years ago

@cooperaj Do you also know how long it takes before a "beta" state becomes stable with the UK.gov services (on average)?

cooperaj commented 3 years ago

@DragonBe Unsure unfortunately. My current project has been public beta for 4 months so somewhere between that and perpetual a web 2.0 forever. The api linked by Derick has been around in some form or other since January 2018.

EDIT. My bad. I was looking at a different API. Ha... I don't know when this one was made.

DragonBe commented 3 years ago

No worries @cooperaj, I will need to fully investigate if and how I can integrate this service.

jonathanmaron commented 3 years ago

The original scope of DragonBe\Vies\Vies is defined as:

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.

Since the VIES web service no longer provides validation for the United Kingdom, I do not think that we should support validation for the United Kingdom in the component.

Why should the United Kingdom be treated differently from all other non-EU countries that have VAT numbers? There are many. See the second and third tables at: https://en.wikipedia.org/wiki/VAT_identification_number

I think a far more elegant and scalable solution would be to provide a new component with the same API as DragonBe\Vies\Vies that offers validation for non-EU countries.

This would allow developers to create their own validation components that cherry pick the validation routines that they need for their application.

DragonBe commented 3 years ago

As I'm investigating options for the UK, I should really think about a more modular approach for this package where non-European validation services could be added as an external plugin maintained by others rather than it is build-in.

In regards to the whole UK issue, I don't want to remove the logic just yet except I won't submit the request against the EC VIES service any longer as there it will be marked as invalid. I could inform users the structure is valid but validation requires an additional step with a pointer to https://www.tax.service.gov.uk/check-vat-number/enter-vat-details. Would this work?

DragonBe commented 3 years ago

@jonathanmaron I know this is not a solution to still provide VAT validation services for UK VAT ID's, but have a look at #132 as I believe this is an elegant transition for the time being.

Freeaqingme commented 3 years ago

I think the fact that Vies::listEuropeanCountries() still returns 'GB' should be considered a bug as of this year. The rest, I'm not sure.

DragonBe commented 3 years ago

I think it's safe to now make the UK validation a failure as solved in 03231df