• Resolved Dave Loodts

    (@davelo)


    Hi, really thanks for the amazing plugin.
    Question: i know it will check on a valid VAT-number itself. But is there also a check on the billing address?

    Cause if we drop the VAT for some countries, people can use a VAT-number from the internet and get’s a ‘discount’ on price. How can we prevent that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Diego

    (@daigo75)

    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);
    
    Thread Starter Dave Loodts

    (@davelo)

    Thanks for the fast and clear respons. We’ll look into that. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Check on address too?’ is closed to new replies.