chargebee-js-wrappers icon indicating copy to clipboard operation
chargebee-js-wrappers copied to clipboard

Problems with EU-VAT validation

Open dariasamo opened this issue 1 year ago • 0 comments

Hi,

There are 2 problems with EU VAT validation

  1. validateVat function expects vat_number parameter to NOT contain country prefix, otherwise it fails with, i.e. Server side VAT Regex validation failed against regex (CZ)?[0-9]{8,10} for country code CZ But the (CZ)?[0-9]{8,10} regex assumes that CZ prefix should be allowed. It looks like there is some problem on Chargebee side that it probably concatenates country code and VAT number containing country code before testing it against this regex. Otherwise it should pass if this particular regex is used.
  2. Greece should use EL prefix for VAT numbers. See here. Right now vatValidate will only validate correctly if country param is set to GR.

dariasamo avatar Feb 12 '24 11:02 dariasamo