cashier-provider/tinkoff-auth

v2.0.0 2021-11-29 12:23 UTC

This package is auto-updated.

Last update: 2021-11-29 12:23:51 UTC


README

Tinkoff Cashier Authorization Driver

Stable Version Unstable Version Total Downloads License

Note: This driver doesn't need to be installed in the application. I's needed to implement Tinkoff bank authorization for Cashier drivers.

Installation

To get the latest version of Tinkoff Auth Cashier Driver, simply require the project using Composer:

$ composer require cashier-provider/tinkoff-auth

Or manually update require block of composer.json and run composer update.

{
    "require": {
        "cashier-provider/tinkoff-auth": "^2.0"
    }
}

Using

Without Hashed Token

In some cases, for example, to initialize a payment session, it is necessary to transmit terminal_key and terminal_secret in clear text. In such cases, the $hash = false parameter must be specified in the request.

namespace CashierProvider\Tinkoff\QrCode\Requests;

use CashierProvider\Core\Http\Request;
use CashierProvider\Tinkoff\Auth\Auth;

class Init extends Request
{
    // You need to provide a link to the authorization class:
    protected $auth = Auth::class;

    protected $hash = false;
}

With Hashed Token

In cases where the request must be signed with a special hashed token, you must set the $hash variable to true.

namespace CashierProvider\Tinkoff\QrCode\Requests;

use CashierProvider\Core\Http\Request;
use CashierProvider\Tinkoff\Auth\Auth;

class Get extends Request
{
    protected $auth = Auth::class;

    protected $hash = true;
}