davidvandertuijn/vat-validator
最新稳定版本:1.1
Composer 安装命令:
composer require davidvandertuijn/vat-validator
包简介
VAT Validator
README 文档
README
This VAT Number Validation library allows users to verify VAT numbers with high accuracy by leveraging both regular expressions and the VIES (VAT Information Exchange System) service. This dual-layer validation ensures that VAT numbers are correctly formatted and legally valid within the European Union.
Install
composer require davidvandertuijn/vat-validator
Usage
use Davidvandertuijn\VatValidator\Validator as VatValidator;
$vatValidator = new VatValidator; $vatValidator->validate('NL821783981B01'); // true if ($vatValidator->isValid()) { $metaData = $vatValidator->getMetaData(); }
[
"name" => "FLORO WEBDEVELOPMENT B.V.",
"address" => "WESTBLAAK 00180 3012KN ROTTERDAM"
]
Strict
In this VAT Number Validation library, when strict mode is set to FALSE, the validation process is more flexible, especially in scenarios where the VIES (VAT Information Exchange System) service is temporarily unavailable. In such cases, the validation will return TRUE, allowing the workflow to continue without disruption due to service timeouts or SOAP errors.
$vatValidator->setStrict(false); // default = true
Cache
To optimize the validation process and reduce the dependency on the VIES (VAT Information Exchange System) service, we recommend caching valid VAT numbers within your application. This approach minimizes repeated requests to the VIES service and improves overall performance.
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-02