th3mouk/vatlayer

vatlayer.com 的 PHP 封装器

0.1.1 2021-02-26 10:52 UTC

This package is auto-updated.

Last update: 2024-08-26 20:08:01 UTC


README

这个 PHP 库是 vatlayer.com 的封装器,遵循 PSR18/PSR17/PSR7。

Latest Stable Version Latest Unstable Version Total Downloads License

CI Scrutinizer Code Quality .gitattributes

安装

composer require th3mouk/vatlayer

使用方法

use Th3Mouk\VatLayer\Psr18Wrapper;

// Client respecting PSR18
// @see https://packagist.org.cn/providers/psr/http-client-implementation
$http_client = WhateverYouWant();

// Request factory respecting PSR17
// @see https://packagist.org.cn/providers/psr/http-factory-implementation
$request_factory = WhateverYouWantToo();

// Or automatically take an http client with
// composer require php-http/discovery
$http_client = Psr18ClientDiscovery::find();
$request_factory = Psr17FactoryDiscovery::findRequestFactory();

$wrapper = new Psr18Wrapper('access_key', $http_client, $request_factory);
$response = $wrapper->validate('vat_number');

端点覆盖范围

原始文档

  • 增值税号验证
  • 通过国家代码获取增值税率
  • 通过 IP 地址获取增值税率
  • 通过客户端 IP 获取增值税率
  • 检索所有欧盟增值税率
  • 符合增值税的价格计算