asavenkov/kontur-focus

Kontur.Focus API 客户端库

0.1.3 2021-08-20 17:02 UTC

This package is auto-updated.

Last update: 2024-09-20 23:49:07 UTC


README

Latest Stable Version Total Downloads License

安装

composer require asavenkov/kontur-focus

需求

  • PHP 7.4.0+
  • Guzzle 6.3+

用法

创建 API 客户端实例

$token = "Replace with Kontur.Focus API key";
$client = new \ASavenkov\KonturFocus\Client($token);

然后按照以下指定调用 API 方法。

关于合同方的快速报告

inn - ИНН(ИП)

ogrn - ОГРН(ИП)

focusHref - 在 Контур.Фокусе 的法人/个体工商户卡片链接(工作需要订阅 Контур.Фокус 并进行额外授权)

href - 在 Контур.Фокусе 的快速报告的个体链接

greenStatements - 绿色标记信息的存在

yellowStatements - 黄色标记信息的存在

redStatements - 红色标记信息的存在

$inn = '6663003127';
$briefReport = $client->getBriefReport($inn);
var_dump($briefReport);

class ASavenkov\KonturFocus\Models\BriefReport#83 (7) {
  public string $inn =>
  string(10) "6663003127"
  public string $ogrn =>
  string(13) "1026605606620"
  public string $focusHref =>
  string(50) "https://focus.kontur.ru/entity?query=1026605606620"
  public string $href =>
  string(188) "https://focus-lite.kontur.ru/briefReport?ogrn=1026605606620&mac=6e0ffc0d857f91b5f879de457d0915b6ee2a6b2f&ltoken=_Xps6cOqRUL19mvogIMjqiBd87EWDQJH20_8HLDbnHLheAGlNP6h0x4HmZTHgjCKzaa1uhk5Q001"
  public bool $greenStatements =>
  bool(true)
  public bool $yellowStatements =>
  bool(false)
  public bool $redStatements =>
  bool(false)
}

扩展分析

inn - ИНН(ИП)

ogrn - ОГРН(ИП)

focusHref - 在 Контур.Фокусе 的法人/个体工商户卡片链接(工作需要订阅 Контур.Фокус 并进行额外授权)

isMSP - 法人特征。在小型和中型企业主体统一注册登记(税务局)中存在微型/小型/中型企业类别

isRNP - 政府合同。组织在不良供应商注册(联邦反垄断局,联邦国库)中找到

$inn = '6663003127';
$analytics = $client->getAnalytics($inn);
var_dump($analytics);

class ASavenkov\KonturFocus\Models\Analytics#108 (5) {
  public string $inn =>
  string(10) "6663003127"
  public string $ogrn =>
  string(13) "1026605606620"
  public string $focusHref =>
  string(50) "https://focus.kontur.ru/entity?query=1026605606620"
  public bool $isMSP =>
  bool(false)
  public bool $isRNP =>
  bool(false)
}

开发设置

$ composer install
$ ./vendor/bin/phpunit

贡献

欢迎Pull请求。对于重大更改,请首先提出问题以讨论您想更改的内容。

确保根据需要添加或更新测试。

使用Conventional Commits作为提交消息。

许可证

MIT