tarfin-labs/tax-identification-number
最新稳定版本:v1.2.0
Composer 安装命令:
composer require tarfin-labs/tax-identification-number
包简介
API client for validating Tax Identification Number.
README 文档
README
Introduction
With this package you can get tax offices by city plates and validate tax identification numbers on GIB (Gelir İdaresi Başkanlığı).
This package requires PHP
7.4or higher.
Installation
You can install the package via composer:
composer require tarfin-labs/tax-identification-number
Usage
Listing tax offices by city plate:
use TarfinLabs\TaxIdentificationNumber\Validation; use TarfinLabs\TaxIdentificationNumber\Exceptions\NotFoundException; try { $offices = Validation::init()->getTaxOfficesByCityPlate(34); } catch (NotFoundException $e) { echo $e->getMessage(); }
Output:
[
[
"code" => "034XXX",
"name" => "TAX OFFICE NAME 1",
],
[
"code" => "034XXY",
"name" => "TAX OFFICE NAME 2
],
]
Validating a tax identification number:
use TarfinLabs\TaxIdentificationNumber\Validation; try { $response = Validation::init()->validate(1234567890, '034455'); $response->isValid(); // boolean $response->getStatus(); // "1" $response->getTckn(); // "" $response->getStatusText(); // "FAAL" $response->getTaxNumber(); // "123123123" $response->getTaxOfficeNumber(); // "034455" $response->getCompanyTitle(); // "ACME INC." } catch (\Throwable $e) { echo $e->getMessage(); }
If you want to validate a TCKN for a sole proprietorship, you need to give TCKN (11 characters) as first parameter to validate() method.
use TarfinLabs\TaxIdentificationNumber\Validation; try { $response = Validation::init()->validate(12345678902, '034455'); $response->isValid(); // boolean $response->getStatus(); // "1" $response->getTckn(); // "12345678902" $response->getStatusText(); // "FAAL" $response->getTaxNumber(); // "9999999999" $response->getTaxOfficeNumber(); // "034455" $response->getCompanyTitle(); // "METİN KAYA" } catch (\Throwable $e) { echo $e->getMessage(); }
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email development@tarfin.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 10.92k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-27