Skip to content

Commit

Permalink
Bump dependencies (fixes online EU VAT number validation)
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Oct 21, 2022
1 parent ee4881a commit 403b38e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions lib/sales_tax.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,12 @@ SalesTax.prototype.validateTaxNumber = function(
// European Union member states (sourced from dynamic list)
if ((region_countries.EU || []).indexOf(countryCode) !== -1) {
return new Promise(function(resolve, reject) {
// Validate EU VAT number
var validationInfo = validate_eu_vat.checkVAT(cleanTaxNumber);
// Validate EU VAT number (offline check)
var validationInfo = validate_eu_vat.checkVAT(
cleanTaxNumber, validate_eu_vat.countries
);

// Check if VAT number is valid
var isValid = (validationInfo.isValid && true);

// No country match?
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
},
"dependencies": {
"request": "2.88.2",
"validate-vat": "0.8.0",
"jsvat": "1.2.4",
"validate-vat": "0.9.0",
"jsvat": "2.5.3",
"ein-validator": "1.0.1"
},
"devDependencies": {
Expand Down

0 comments on commit 403b38e

Please sign in to comment.