andrzejl/wl-api-client

Wl API客户端

1.2 2021-04-29 06:20 UTC

This package is auto-updated.

Last update: 2024-09-29 05:55:29 UTC


README

WlApiClient是用于WL API(API Wykazu podatnikow VAT)的库

要求

WlApiClient依赖于HTTPlug,并需要虚拟包php-http/client-implementation。请在安装前查看http://docs.php-http.org/en/latest/httplug/users.html

安装

composer require andrzejl/wl-api-client

或者安装所有依赖项

composer require php-http/guzzle6-adapter nyholm/psr7 andrzejl/wl-api-client

使用方法

require 'vendor/autoload.php';

use Andrzejl\WlApi\Client;

$client = new Client;
$result = $client->searchBankAccounts(['70506405335016096312945164']);

限制

WL API有限制。每天最多可以使用搜索方法10次,每次查询最多30个元素。超出限制的查询将抛出LimitExceeded异常。

当传入超过30个元素时,搜索查询将被拆分。

检查方法每天也有10次请求的限制,并且这个限制与搜索方法共享。

测试

composer test

PHP 5.6兼容性

在旧版PHP 5.6项目中使用WlApiClient v0.3

composer require --ignore-platform-reqs php-http/guzzle6-adapter ^1.0 php-http/httplug ^1.0 php-http/message ^1.0 andrzejl/wl-api-client ^0.3