receiver1 / omnipay-tinkoff
Tinkoff.Payments gateway for Omnipay
dev-master
2024-06-17 16:30 UTC
Requires
- php: >=7.1
- ext-json: *
- omnipay/common: ^3.0
This package is auto-updated.
Last update: 2024-10-17 17:10:16 UTC
README
Подержка эквайринга через Tinkoff для Omnipay
Установка
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();