TaxIdValidatorInterface ​
- Type
- Interface
- Namespace
- craft\commerce\base
- Implemented by
- craft\commerce\taxidvalidators\EuVatIdValidator
- Since
- 5.3.0
Interface for Tax ID Validators.
Public Methods ​
Method | Description |
---|---|
displayName() | The display name of this tax ID type. |
isEnabled() | Tests if the validator is available for use by tax rates. |
validate() | This would usually just call validateFormat() and then validateExistence() and return the result. |
validateExistence() | Tests if the ID exists as valid in the country's tax system. This would usually be an API call. |
validateFormat() | Tests if the ID looks generally correct. This would usually be something like a regex check. |
displayName()
​
- Since
- 5.3.0
The display name of this tax ID type.
Returns ​
isEnabled()
​
- Since
- 5.3.0
Tests if the validator is available for use by tax rates.
This would usually be a check against the existence or settings or API keys so that the validator can be used.
Returns ​
validate()
​
- Since
- 5.3.0
This would usually just call validateFormat() and then validateExistence() and return the result.
Arguments ​
$idNumber
(string)
Returns ​
validateExistence()
​
- Since
- 5.3.0
Tests if the ID exists as valid in the country's tax system. This would usually be an API call.
Arguments ​
$idNumber
(string)
Returns ​
validateFormat()
​
- Since
- 5.3.0
Tests if the ID looks generally correct. This would usually be something like a regex check.
Arguments ​
$idNumber
(string)