receiver1/omnipay-tinkoff

Tinkoff.Payments gateway for Omnipay

dev-master 2024-06-17 16:30 UTC

This package is auto-updated.

Last update: 2024-11-17 17:22:49 UTC


README

Подержка эквайринга через Tinkoff для Omnipay

Software License

Установка

composer require league/omnipay receiver1/omnipay-tinkoff

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

// Создаём новый платёжный шлюз
$gateway = Omnipay::create('Tinkoff');

$gateway->setTerminalId('TerminalId');
$gateway->setPassword('TerminalPassword');

// Создаём новый платёж на сумму 10 руб. 00 коп. с идентификатором заказа 1234 
$request = $gateway->purchase([
  'amount' => 10,
  'orderId' => 1234,
  'description' => 'optional',
  'customerKey' => 'optional',
  'notificationUrl' => 'optional',
  'successUrl' => 'optional',
  'failUrl' => 'optional',
]);

$log->write(print_r($request->getData(), true));
$response = $request->send();

if (!$response->isSuccessful()) {
  $log->write($response->getDetailMessage());
  throw new Exception($response->getMessage());
}

$log->write(print_r($response->getData(), true));
return $response->gitRedirectUrl();