• Sometimes, VIES is down.

    Other times, the service returns GLOBAL_MAX_CONCURRENT_REQ or MS_MAX_CONCURRENT_REQ and VAT number is also not validated.

    I would like to have an option to always accept the VAT number if VIES is not available or blocking the request. So that the customer can always checkout.

    Can you add this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi @cvl01,

    Thanks for reaching out. I am sorry to know you are experiencing issues.

    If you are receiving the “MS_MAX_CONCURRENT_REQ” error, please go to the “Admin & Advanced” section and enable the “Reduce concurrent request to VIES” option. Also, if you can try to utilize the “VAT numbers to pass validation” option, In this case, you have to enter the VAT IDs separated by commas that have been manually validated.

    Please give it a try.

    Kind regards.

    Thread Starter Christiaan van Luik

    (@cvl01)

    Dear Moshtafizur,

    Sometimes the VAT service is totally down. Like, the EU vat website is returning 5xx errors. In those cases I would like to accept everything that is inputted. Your suggested solution does not solve this.

    So, I would like to request a new option/setting: to always accept the VAT number if VIES is not available or blocking the request. So that the customer can always checkout.

    Plugin Author Omar AlDabbas

    (@omardabbas)

    Hi @cvl01,

    So basically, you’re looking for an option to “turn off” the plugin validation if VIES isn’t working properly?

    We have an option to turn off validation (at the top of validation tab), but this will keep VAT amounts, as I understand, you want to remove VAT amount from order, here comes a few points:

    1. Will this option be manually enabled/disabled? If yes, then we can simply disable the plugin (and remove tax) if you only sell B2B. If no (automatic), then how to tell if VIES is down to trigger the option to work (as there are a lot of cases when VIES can’t work properly).
    2. Is this compliant? I doubt, since you’re removing VAT for everyone.

    Would love to hear your thoughts.

    Omar

    Thread Starter Christiaan van Luik

    (@cvl01)

    Yes, indeed I want to turn off the validation if vies is down. Not for all errors ofcourse, if the number is invalid that should be shown.

    1. I also sell B2C and for B2B I would like to have the validation (as long as vies is working)
    2. It is maybe not compliant but if VIES is down for 30 minutes on a day it costs us orders / money, and we are willing not to comply. In order to comply it is allowed to verify afterwards. If the number is afterwards found to be invalid we can cancel the order and not ship or contact the customer to correct something. Anyway, dealing with the compliance is something we can do and are aware of.

    Regarding: how to tell if VIES is down

    I have used another EU vat plugin before, that had this functionality. I could check to see the code what conditions they have implemented. But what would seem logic to me is to activate this functionality under the following conditions:

    • If VIES returns a 5xx error (their server is unreachable/down)
    • If VIES does return a response but their error code is GLOBAL_MAX_CONCURRENT_REQ or MS_MAX_CONCURRENT_REQ

    Or do it otherwise, and activate this functionality whenever the valid/invalid data is not in the response. Which is also an easy way to check.

    Plugin Author Omar AlDabbas

    (@omardabbas)

    Hey @clv01,

    Thanks for the info, I’ve discussed with the team and we will be implementing an option in the plugin to allow this.

    In short, once enabled, it will work smoothly and sends every call to VIES, once we get a response with either of these:

    MS_UNAVAILABLE
    GLOBAL_MAX_CONCURRENT_REQ
    MS_MAX_CONCURRENT_REQ

    Then VAT amount will be removed, and a message will appear (customizable from admin) highlighting this, something like “VIES is currently unavailable. You are allowed to place an order, and this order confirmation is subject to VAT validation by the admin”

    Hope this meets your needs.

    Omar

    Thread Starter Christiaan van Luik

    (@cvl01)

    Hi Omar,

    I saw the change, checked the code, thanks! However, it does not totally fix what I needed. Now, the solution only checks for defined error codes, like so.

    $accepted_exception = array('MS_UNAVAILABLE', 'GLOBAL_MAX_CONCURRENT_REQ', 'MS_MAX_CONCURRENT_REQ');
    if( in_array($exception->getMessage(), $accepted_exception) ) {
    alg_wc_eu_vat_session_set( 'alg_wc_eu_vat_vies_error_message', $exception->getMessage() );

    return false;
    }

    But, for example if the VIES service servers are down, it does not return any of these codes but a 5xx error.
    So, what I mean is add this kind of code

    try {
    // YOUR CODE HERE
    } catch (SoapFault $fault) {
    if ($fault->faultcode >= 500 && $fault->faultcode < 600) {
    // Custom handling for 5xx errors
    // ACCEPT THE VAT BECAUSE VIES IS DOWN
    }
    }
    Plugin Contributor Kousik Mukherjee

    (@kousikmukherjeeli)

    Hey @clv01,

    Your suggestion is good, and we will implement it in another catch in our next release. However, I want to understand and confirm where you found the condition for fault codes between 500 and 600.


    if ($fault->faultcode >= 500 && $fault->faultcode < 600) { }

    Regards
    Kousik Mukherjee

    Thread Starter Christiaan van Luik

    (@cvl01)

    The condition for $fault->faultcode is my suggestion, it is not currently in the code. I added this example to illustrate what I mean. Of course you can always implement it differently. Checking >=500 and < 600 is an easy way of handling all server-related errors.

    Plugin Contributor Kousik Mukherjee

    (@kousikmukherjeeli)

    Hey @clv01,

    You can check the latest version of the plugin, 2.12.7.

    Regards,
    Kousik Mukherjee

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.