PHPackages                             vanta/t-id-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vanta/t-id-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vanta/t-id-client
=================

Pure client for t id

0.1(1y ago)00MITPHPPHP ^8.3CI passing

Since Apr 21Pushed 1y agoCompare

[ Source](https://github.com/VantaFinance/t-id)[ Packagist](https://packagist.org/packages/vanta/t-id-client)[ RSS](/packages/vanta-t-id-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (21)Versions (2)Used By (0)

T id клиент
===========

[](#t-id-клиент)

Клиент для общения с [API t id](https://developer.tbank.ru/docs/products/TID/w2w).

Установка
---------

[](#установка)

Минимальная версия PHP: 8.3

1. Выполнить `composer require vanta/t-id-client`
2. Обязательно установить PSR-совместимый клиент

Использование
-------------

[](#использование)

Создание инстанса клиента:

```
use GuzzleHttp\Client;
use Vanta\Integration\TId\Infrastructure\HttpClient\ConfigurationClient;
use Vanta\Integration\TId\RestClientBuilder;

$restClientBuilder = RestClientBuilder::create(new ConfigurationClient('ваш ClientId', 'ваш ClientSecret', 'https://id.tbank.ru', 'https://business.tbank.ru'), new Client());

$restUserClient = $restClientBuilder->createUserClient();

$restDocumentClient = $restClientBuilder->createDocumentClient();

$restUserStatusClient = $restClientBuilder->createUserStatusClient();
```

Генерация URL для авторизации пользователя:
-------------------------------------------

[](#генерация-url-для-авторизации-пользователя)

```
use GuzzleHttp\Client;
use Vanta\Integration\TId\Infrastructure\HttpClient\ConfigurationClient;
use Vanta\Integration\TId\RestClientBuilder;

RestClientBuilder::create(new ConfigurationClient('ваш ClientId', 'ваш ClientSecret', 'https://id.tbank.ru', 'https://business.tbank.ru'), new Client());
    ->createAuthUrlBuilder('https://id.tbank.ru', 'ваш redirectUrl')
    ->build()
;
```

Получение данных о пользователе:
--------------------------------

[](#получение-данных-о-пользователе)

```
$pairKey = $restUserClient->getPairKeyByAuthorizationCode('get параметр code, из url-а, на который вернулся пользователь', 'ваш redirectUrl');

$restUserClient->getUser($pairKey->accessToken);
```

Тестовая среда:
---------------

[](#тестовая-среда)

```
use GuzzleHttp\Client;
use Vanta\Integration\TId\Infrastructure\HttpClient\ConfigurationClient;
use Vanta\Integration\TId\RestClientBuilder;

$restDocumentClient = $restClientBuilder
    ->addMiddleware(new SandboxBusinessClientMiddleware())
    ->createDocumentClient()
;

$restUserStatusClient = $restClientBuilder
    ->addMiddleware(new SandboxBusinessClientMiddleware())
    ->createUserStatusClient()
;

$pairKey = PairKey::createSandboxPairKey();

$restDocumentClient->getAddress($pairKey->accessToken, AddressType::RESIDENCE_ADDRESS);
```

Тестовая среда имеет следующие ограничения:

```
1. Не работает url авторизации пользователя
2. Не работает запрос $restUserClient->getPairKeyByAuthorizationCode('get параметр code, из url-а, на который вернулся пользователь', 'ваш redirectUrl');
3. Не работает запрос данных пользователя $restUserClient->getUser($pairKey->accessToken);
4. API т-банка в запросе $restUserClient->getAuthIntrospect($pairKey->accessToken);,
на тесте возвращает только 1 поле: active, на prod-е возвращает все поля, решили сделать все поля ответа обязательными

```

todo:
-----

[](#todo)

1. Подумать о том, чтобы отказаться от enum-а src/Struct/Scope.php в пользу строк, т.к. т-банк добавляет в него внутренние значения, и мы можем получить неожиданную ошибку на prod-е

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance48

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

392d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/37250ac0f6117b7d479802e14fcc870f2e2a85e6c6f26a037cfacb08b3db70a1?d=identicon)[shashkov.root](/maintainers/shashkov.root)

---

Top Contributors

[![root-aza](https://avatars.githubusercontent.com/u/13816704?v=4)](https://github.com/root-aza "root-aza (2 commits)")

---

Tags

t-banktt id

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vanta-t-id-client/health.svg)

```
[![Health](https://phpackages.com/badges/vanta-t-id-client/health.svg)](https://phpackages.com/packages/vanta-t-id-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k136](/packages/symfony-ai-platform)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[symfony/ai-agent

PHP library for building agentic applications.

30536.7k44](/packages/symfony-ai-agent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
