chargebee-js-wrappers
chargebee-js-wrappers copied to clipboard
Problems with EU-VAT validation
Hi,
There are 2 problems with EU VAT validation
-
validateVat
function expectsvat_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 thatCZ
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. - Greece should use
EL
prefix for VAT numbers. See here. Right nowvatValidate
will only validate correctly ifcountry
param is set toGR
.