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 today

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

25

—

LowBetter than 35% of packages

Maintenance45

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

439d 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.5k5.9M737](/packages/sylius-sylius)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[symfony/ai-platform

PHP library for interacting with AI platform provider.

521.4M289](/packages/symfony-ai-platform)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

12310.5M135](/packages/web-auth-webauthn-lib)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)

PHPackages © 2026

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