craftcms / craftcms/docs

[Content]: Commerce 5.7 VAT validation

Open Beginner friendly
#770 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
42
Forks
160
Avg merge
3h 9m
Merged PRs (30d)
4

Description

Product

Commerce 5.7

Craft Commerce 5.7 requires ibericode/vat 2.0 or later. If you have a custom plugin or module that extends Commerce's VAT validation and calls methods directly on a DvK\Vat\Validator instance, you will need to update those calls — the namespace has changed from DvK\Vat to Ibericode\Vat, and the method names have been renamed:

validateFormat() -> validateVatNumberFormat()
validateExistence() -> validateVatNumberExistence()
validate() -> validateVatNumber()

Note that validateVatNumberExistence() is now a protected method and can no longer be called directly on the validator instance.

Internally we no longer use this dependancy for VAT validation.

We recommend no longer using this dependency and creating a validator plugin. See https://github.com/craftcms/commerce-uk-vat-id-validator for an example of providing your own tax number validator that works with the tax system.

If you were using the getVatValidator() method to retrieve a validator instance, note that this method was deprecated in Commerce 5.3.0 in favor of Taxes::getEnabledTaxIdValidators() and should be replaced accordingly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Commerce 5.7 upgrade or breaking-changes documentation. Add the VAT validator namespace and method renames, the protected-method limitation, the recommendation to use a validator plugin, and the replacement for getVatValidator(). Done means the migration guidance covers each compatibility change described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.