Add special handling for the MS_MAX_CONCURRENT_REQ error

Created on 2 December 2024, about 2 months ago

Problem/Motivation

We're using this module on a couple forms and noticed in the logs that the following error code is regularly being returned by the VIES service:

MS_MAX_CONCURRENT_REQ

As you can find in the documentation of the WSDL of this service:

MS_MAX_CONCURRENT_REQ: Your Request for VAT validation has not been processed; the maximum number of concurrent requests for this Member State has been reached. Please re-submit your request later or contact TAXUD-VIESWEB@ec.europa.eu for further information": Your request cannot be processed due to high traffic towards the Member State you are trying to reach. Please try again later.

I propose we inform the user about this through an error message and ask them to try again in a couple minutes, instead of telling them they entered a wrong VAT number. This last part also applies to other error codes returned by the VIES service, in that case we shouldn't tell users they entered a wrong VAT number.

Steps to reproduce

This happens quite randomly, it's hard to reproduce.

Proposed resolution

Show more informative validation messages.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @dieterholvoet
  • 🇧🇪Belgium dieterholvoet Brussels

    Apparently there are more possible error codes that we could handle:

    In case of problems, the returned FaultString can take the following specific values:

    INVALID_INPUT: The provided CountryCode is invalid or the VAT number is empty;

    GLOBAL_MAX_CONCURRENT_REQ: Your Request for VAT validation has not been processed; the maximum number of concurrent requests has been reached.
    Please re-submit your request later or contact TAXUD-VIESWEB@ec.europa.eu for further information": Your request cannot be processed due to high traffic on the web application. Please try again later;

    MS_MAX_CONCURRENT_REQ: Your Request for VAT validation has not been processed; the maximum number of concurrent requests for this Member State has been reached.
    Please re-submit your request later or contact TAXUD-VIESWEB@ec.europa.eu for further information": Your request cannot be processed due to high traffic towards the Member State you are trying to reach. Please try again later.

    SERVICE_UNAVAILABLE: an error was encountered either at the network level or the Web application level, try again later;

    MS_UNAVAILABLE: The application at the Member State is not replying or not available. Please refer to the Technical Information page to check the status of the requested Member State, try again later;

    TIMEOUT: The application did not receive a reply within the allocated time period, try again later.

    I thought about this some more and I feel like we should provide an option to choose what to do when connection to the database fails: fail validation and ask the user to try again later, or pass validation and only rely on the regex-based validation. These requirements can depend on the application, so I think it makes sense to make it configurable.

  • 🇧🇪Belgium dieterholvoet Brussels

    I added a 'Fail validation if the VIES database is unavailable' option that allows you to pass validation if the VIES database is unreachable. This option is enabled by default, so existing installations are not impacted.

  • Pipeline finished with Skipped
    1 day ago
    #398830
  • 🇧🇪Belgium dieterholvoet Brussels
Production build 0.71.5 2024