The EU VAT Assistant doesn’t compare the address entered by the customer with the VAT number. Checking the address as well turned out to be too difficult, because there isn’t a standard way to do that. Each EU country can store an address in a multitude of variations (e.g. “1, Main Street”, “Main Street, 1”, “Main St. 1”, “1, Main Str”) and in multiple languages. That would dramatically increase the chance of false negatives. One could attempt to implement a “fuzzy match” logic, but we don’t have sufficient resources or expertise to implement such a feature.
In addition to this, there’s also the fact that a malicious user could simply enter the correct billing details of a company, which are publicly available, and get a VAT exemption anyway. Simply enter the VAT number in the VIES system and you get all the details to enter in the billing address to pass the validation.
Due to the above, we didn’t implement an address validation logic. If you wish, you could try to implement your custom validation, by writing a filter for hook wc_aelia_eu_vat_assistant_customer_vat_exemption
. Example:
add_filter('wc_aelia_eu_vat_assistant_customer_vat_exemption', $customer_vat_exemption, $vat_country, $vat_number, $vat_number_validated, $raw_vat_validation_response) {
// $raw_vat_validation_response contains the whole response returned by the VIES service, including the address.
// You can check such address and return "true" (apply exemption) or "false" (don't apply exemption), depending
// on that data
return $customer_vat_exemption;
}, 10, 5);