定制 davidvandertuijn/vat-validator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

davidvandertuijn/vat-validator

最新稳定版本:1.1

Composer 安装命令:

composer require davidvandertuijn/vat-validator

包简介

VAT Validator

README 文档

README

Total Downloads Latest Stable Version License

VAT Validator

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.

"Buy Me A Coffee"

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-02