PHPackages                             clanmax/tinkoff-autopay - 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. [Payment Processing](/categories/payments)
4. /
5. clanmax/tinkoff-autopay

ActiveLibrary[Payment Processing](/categories/payments)

clanmax/tinkoff-autopay
=======================

Small library for working with automatic payment methods in Tinkoff API

0.3.2(2y ago)058GPL-3.0-or-laterPHPPHP ^7.1|^8.0

Since Nov 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ClanMax/tinkoff-autopay)[ Packagist](https://packagist.org/packages/clanmax/tinkoff-autopay)[ RSS](/packages/clanmax-tinkoff-autopay/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (10)Used By (0)

Tinkoff Autopay
===============

[](#tinkoff-autopay)

Small library which help you to use methods from [Tinkoff API Documentation](https://www.tinkoff.ru/kassa/dev/payments/).

It was made for Laravel 7.0, but basically it working on Laravel 11 and almost all others PHP applications.

It use some of [Laravel-Tinkoff](https://github.com/kenvel/laravel-tinkoff) functions inside.

What it's doing
---------------

[](#what-its-doing)

Just basic things. For example, we can:

- Add customer
- Get customer data
- Remove customer
- Get card list of customer
- Remove customer cards
- Charge money

You have to be sure you already have permission to use this kind of function. You could ask your own manager in Tinkoff bank.

Which methods supported
-----------------------

[](#which-methods-supported)

To be more clear it's work with:

- `Init`
- `AddCustomer`
- `GetCustomer`
- `RemoveCustomer`
- `GetCardList`
- `RemoveCard`
- `Charge`

This library not implement `Init` method in version 0.01. But it's implemented in 0.02.

Probably in some close future I will add `FinishAuthorize` method, but not sure right now.

What in plans
-------------

[](#what-in-plans)

1. `FinishAuthorize` probably will work
2. Right now library not return additional values of users (email, IP, etc). Will fix it.

How does it work
----------------

[](#how-does-it-work)

Install library from composer

```
composer require clanmax/tinkoff-autopay
```

Connect library with you controller by using `use`

```
use ClanMax\TinkoffAutopay;
```

Logic
-----

[](#logic)

Step by step how to use `Charge`

### Preparing

[](#preparing)

1. Add customer (it will be added automatically in `Init` method, btw)
2. Request `Init` *(not included in 0.01)* with `CustomerKey` and `Recurrent` parameters
3. Redirect user to payment form from `PaymentURL` value

### Charging

[](#charging)

1. Request `Init` without `CustomerKey` and `Recurrent` parameters
2. Save `PaymentID`
3. Request `GetCardList` and take from card which you want to use `RebillId`
4. Request `Charge` with `PaymentID`, `RebillId`, and [OperationInitiatorType](https://www.tinkoff.ru/kassa/dev/payments/#section/Peredacha-priznaka-iniciatora-operacii)

In this case user will be charged automatically and payment will be approved instantly.

How to use
----------

[](#how-to-use)

Make sure you already have Terminal Key and Terminal Password from you bank account. For using `FinishAuthorize` method you can get public key when switch you terminal working mode to Mobile application.

```
$terminalKey = "16009807012222DEMO"; // demo may help to deploy
$terminal_password = "password";
$terminalurl = "https://securepay.tinkoff.ru/v2/";

$bank = new TinkoffAutopay($terminalurl,$terminalKey,$terminal_password);
```

### Initial payment

[](#initial-payment)

Make `POST` request to `Init` with two additional parameters:

```
{
"Recurrent": "Y",
"CustomerKey": "clanmax",
"OperationInitiatorType": "2" // just example. check https://www.tinkoff.ru/kassa/dev/payments/#section/Peredacha-priznaka-iniciatora-operacii
}
```

Where `CustomerKey` name of already added client and `Recurrent` just with `Y`

For example:

```
$payment = [
  'OrderId'       => '2223',
  'Amount'        => '1000',
  'Language'      => 'ru',
  'Reccurent'     => 'Y',
  'CustomerKey'   => "clanmax",
  'Description'   => 'One month pay',
  'Email'         => 'me@email.com',
  'Phone'         => '+79517474837',
  'Name'          => 'Vlad',
  'Taxation'      => 'usn_income'
];

$items[] = [
  'Name'  => 'Something you gonna pay',
  'Price' => '1000',
  'Tax'   => 'none',
];

$bank->Init($payment,$items);
```

Return will look like this:

```
{
	'Success' = '1',
	'Status' = 'NEW',
	'PaymentURL' = "https://securepay.tinkoff.ru/new/58NbcI0s",
	'PaymentId' = '360127329'
}
```

Just to be sure Tax in Items could be:

- osn — общая
- usn\_income — упрощенная (доходы)
- usn\_income\_outcome — упрощенная (доходы минус расходы)
- patent — патентная
- envd — единый налог на вмененный доход
- esn — единый сельскохозяйственный налог

### Charge money

[](#charge-money)

Few steps:

1. Make `POST` request to Init, but without `Recurrent` and `CustomerKey`
2. Grab `PaymentId` from there

```
$charge = $bank->Charge($PaymentId,$RebillId);
```

### Add customer

[](#add-customer)

You have to make customer always before he did pay. One customer may have lots of connected cards by `Init` method.

```
$customer = $bank->AddCustomer($CustomerKey);
```

### Get customer

[](#get-customer)

Return existing customers. You have to have his name which you used before.

```
$customer = $bank->GetCustomer($CustomerKey);
```

### Remove customer

[](#remove-customer)

Just removing all data of user. Be sure you won't use `RebillId` of this user anymore.

```
$customer = $bank->RemoveCustomer($CustomerKey);
```

### Get card list

[](#get-card-list)

You will use this method for get `RebillId`. Return bunch of cards which user saved by `Init` method.

```
$cards = $bank->GetCardList($CustomerKey);
```

### Remove card

[](#remove-card)

If your client have tons of cards but you are not ready to use them instead of delete user you may just delete card. Just get card number from `GetCardList`

```
$cards = $bank->RemoveCard($CardId, $CustomerKey);
```

Find errors
-----------

[](#find-errors)

I would recommend always check all request for errors by this way

```
$bank->error ?:
```

`Error` keep some information and you may use it for show to user (but be aware).

Get token
---------

[](#get-token)

In some moment you probably will need token for testing. You may use methods in TinkoffKey class.

How does it work:

- Connect class
- Change your data (or send you own)
- Get data

```
use ClanMax\TinkoffKey;

$test = new TinkoffKey;

return $test;
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Every ~155 days

Recently: every ~310 days

Total

9

Last Release

815d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.3.2PHP ^7.1|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/413290?v=4)[clanmax](/maintainers/clanmax)[@ClanMax](https://github.com/ClanMax)

---

Top Contributors

[![ClanMax](https://avatars.githubusercontent.com/u/413290?v=4)](https://github.com/ClanMax "ClanMax (38 commits)")

---

Tags

acquiringtinkoffreccurent

### Embed Badge

![Health badge](/badges/clanmax-tinkoff-autopay/health.svg)

```
[![Health](https://phpackages.com/badges/clanmax-tinkoff-autopay/health.svg)](https://phpackages.com/packages/clanmax-tinkoff-autopay)
```

###  Alternatives

[professionalweb/payment-laravel

Payment drivers for laravel

159.6k3](/packages/professionalweb-payment-laravel)[paveldanilin/php-tinkoff-payment

Tinkoff payment client for PHP 7.4+

105.1k](/packages/paveldanilin-php-tinkoff-payment)[justcommunication-ru/tinkoff-acquiring-api-client

Tinkoff Acquiring API PHP Client

103.2k](/packages/justcommunication-ru-tinkoff-acquiring-api-client)

PHPackages © 2026

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