Checking vat number should do ToUpper before calling vat service.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 年 前
The service returns INVALID_INPUT for country codes that are not uppercase. So the code should be:

public virtual VatNumberStatus GetVatNumberStatus(string twoLetterIsoCode, string vatNumber,
            out string name, out string address)
        {
            name = string.Empty;
            address = string.Empty;

            if (vatNumber == null)
                vatNumber = string.Empty;
            vatNumber = vatNumber.Trim();

            if (String.IsNullOrEmpty(twoLetterIsoCode))
                return VatNumberStatus.Empty;

            if (String.IsNullOrEmpty(vatNumber))
                return VatNumberStatus.Empty;

            if (!_taxSettings.EuVatUseWebService)
                return VatNumberStatus.Unknown;
            twoLetterIsoCode = twoLetterIsoCode.ToUpper();
            Exception exception = null;
            return DoVatCheck(twoLetterIsoCode, vatNumber, out name, out address, out exception);
        }
12 年 前
Thanks a lot for reporting.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.