定制 rechtlogisch/ust-id 二次开发

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

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

rechtlogisch/ust-id

最新稳定版本:v1.2.0

Composer 安装命令:

composer require rechtlogisch/ust-id

包简介

Validates the German VAT-ID (Umsatzsteuer-Identifikationsnummer)

README 文档

README

Recht logisch USt-ID banner image

Latest Version on Packagist Tests Total Downloads

ust-id

Validates the German VAT-ID (Umsatzsteuer-Identifikationsnummer, short: USt-ID)

Check digit (last digit) is validated based on ISO/IEC 7064, MOD 11,10 as documented within the meanwhile repealed "Datenträger-Verordnung über die Abgabe Zusammenfassender Meldungen – ZMDV" dated 13.05.1993 (BGBl. I S. 736).

Note

This package validates solely the syntax and check digit of the provided input. It does not confirm, that the provided USt-ID was assigned to an entrepreneur. Please use the official VIES service for that.

Installation

You can install the package via composer:

composer require rechtlogisch/ust-id

Usage

isUstIdValid('DE123456788'); // => true

or

use Rechtlogisch\UstId\UstId;

(new UstId('DE123456788'))
    ->validate() // ValidationResult::class
    ->isValid(); // => true

Validation errors

You can get a list of errors explaining why the provided input is invalid. The validate() method returns a DTO with a getErrors() method.

Note

The keys of getErrors() hold the stringified reference to the exception class. You can check for a particular error by comparing to the ::class constant. For example: Rechtlogisch\UstId\Exceptions\InvalidUstIdLength::class.

validateUstId('DE12345678')->getErrors();
// [
//   'Rechtlogisch\UstId\Exceptions\InvalidUstIdLength'
//    => 'USt-ID must be 11 characters long. Provided USt-ID is: 10 characters long.',
// ]

or

use Rechtlogisch\UstId\UstId;

(new UstId('DE12345678'))
    ->validate()
    ->getErrors();
// [
//   'Rechtlogisch\UstId\Exceptions\InvalidUstIdLength'
//    => 'USt-ID must be 11 characters long. Provided USt-ID is: 10 characters long.',
// ]

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover any security-related issues, please email open-source@rechtlogisch.de instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-09