diff --git a/src/pretix/base/services/tax.py b/src/pretix/base/services/tax.py index 5ae1b8810..f12f583b4 100644 --- a/src/pretix/base/services/tax.py +++ b/src/pretix/base/services/tax.py @@ -109,6 +109,9 @@ def _validate_vat_id_EU(vat_id, country_code): if not re.match(vat_moss.id.ID_PATTERNS[cc_to_vat_prefix(country_code)]['regex'], number): raise VATIDFinalError(error_messages['invalid']) + # We are relying on the country code of the normalized VAT-ID and not the user/InvoiceAddress-provided + # VAT-ID, since Django and the EU have different ideas of which country is using which country code. + # For example: For django and most people, Greece is GR. However, the VAT-service expects EL. payload = """ @@ -119,7 +122,7 @@ def _validate_vat_id_EU(vat_id, country_code): - """.strip() % (country_code, number) + """.strip() % (vat_id[:2], number) try: response = requests.post(