Tinkoff Kassa Payment System Integration

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    848
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Tinkoff Kassa Payment System Integration

Tinkoff Kassa is one of most widespread payment gateways in Russian market. Supports Visa, Mastercard, MIR, SBP, Apple Pay, Google Pay and installments via Tinkoff Installment. Official SDK exists for PHP, Java, .NET, Python and Node.js, but most integrations done directly via REST API.

Connection and Access

Two keys needed: TerminalKey and Password. Get them in Tinkoff Business personal account — "Payment Acceptance" → "Terminals". There also configure payment notification (webhook URL) and allowed IP list.

Test environment: https://rest-api-test.tinkoff.ru/v2/ Production environment: https://securepay.tinkoff.ru/v2/

Switching between — only via TerminalKey: test keys start with TinkoffBankTest.

Order Creation and Payment Initialization

Payment initiated via Init method. Basic request:

$params = [
    'TerminalKey' => env('TINKOFF_TERMINAL_KEY'),
    'Amount'      => 150000, // in kopecks
    'OrderId'     => 'order-12345',
    'Description' => 'Order #12345',
    'NotificationURL' => 'https://example.com/webhook/tinkoff',
    'SuccessURL'  => 'https://example.com/payment/success',
    'FailURL'     => 'https://example.com/payment/fail',
];

// Add token
ksort($params);
$tokenStr = implode('', array_values($params)) . env('TINKOFF_PASSWORD');
$params['Token'] = hash('sha256', $tokenStr);

$response = Http::post('https://securepay.tinkoff.ru/v2/Init', $params);
$paymentUrl = $response->json('PaymentURL');

Important token detail: calculated by concatenation of values sorted alphabetically (not keys) plus password. Token generation errors — most common integration problem.

After getting PaymentURL customer redirected to Tinkoff page. All payment UI — on their side.

Webhook and Status Check

After payment Tinkoff sends POST to NotificationURL with data in application/x-www-form-urlencoded format:

public function handleWebhook(Request $request): JsonResponse
{
    $data = $request->all();

    // Check token
    $received  = $data['Token'];
    $checkData = $data;
    unset($checkData['Token']);
    ksort($checkData);
    $expected = hash('sha256', implode('', array_values($checkData)) . env('TINKOFF_PASSWORD'));

    if (!hash_equals($expected, $received)) {
        return response()->json(['error' => 'Invalid token'], 403);
    }

    if ($data['Status'] === 'CONFIRMED') {
        Order::where('id', $data['OrderId'])->update(['status' => 'paid']);
        // send receipt, start shipping logic
    }

    return response()->json(['OK' => true]);
}

Statuses to handle: AUTHORIZED (funds frozen), CONFIRMED (money debited), REJECTED, REFUNDED, PARTIAL_REFUNDED, CANCELED.

Additional protection — check sender IP. Tinkoff publishes IP list in docs, can filter at nginx or middleware level.

Fiscalization via FFD 1.2

If business must issue receipts (54-ФЗ), Receipt object passed in Init request:

'Receipt' => [
    'Email'    => '[email protected]',
    'Taxation' => 'usn_income',
    'Items'    => [
        [
            'Name'          => 'Product 1',
            'Price'         => 100000, // in kopecks
            'Quantity'      => 1.0,
            'Amount'        => 100000,
            'Tax'           => 'none',
            'PaymentMethod' => 'full_payment',
            'PaymentObject' => 'commodity',
        ],
    ],
],

Fiscalization performed by Tinkoff automatically — no need to connect own cash register. Receipt sent to customer email or phone.

Refunds

Refund via Cancel method:

$params = [
    'TerminalKey' => env('TINKOFF_TERMINAL_KEY'),
    'PaymentId'   => '12345678',
    'Amount'      => 75000, // partial refund
];
// add Token by same scheme
Http::post('https://securepay.tinkoff.ru/v2/Cancel', $params);

Full refund — pass Amount equal to order sum or don't pass it.

Timeline and Features

Tinkoff integration testing and approval takes about 2–3 business days: need to conduct several test transactions, after which manager activates production terminal. For fiscalization timeline increases: need to agree on cash register settings. In practice full cycle from getting access to first real payment — 5–7 business days.