1
0
mirror of synced 2024-11-24 22:16:08 +03:00
atol-online-client/README.md
Alexey c68448954b
fix jms/serializer versions (#15)
* fix jms/serializer versions
* add php 7.4 to travis
* fix travis badge
2021-10-29 12:39:14 +03:00

1.4 KiB

Build Status Latest stable

API-клиент для АТОЛ.Онлайн

API-клиент на PHP для сервиса онлайн-фискализации платежей АТОЛ.Онлайн

Требования

  • PHP 7.2 и выше
  • PHP extension cURL

Пример использования

$atol = new \AtolOnlineClient\AtolOnline();

$connection = new \AtolOnlineClient\Configuration\Connection();
$connection->version = \AtolOnlineClient\AtolOnlineApi::API_VERSION_V4;
$connection->login = 'login';
$connection->pass = 'pass';
$connection->group = 'group';

$config = new \AtolOnlineClient\Configuration();
$config->connections = [$connection];

$client = new \Guzzle\Http\Client();

$api = $atol->createApi($client, $connection);

// $api->setLogger(...);
// $api->setCache(...);

// собираем объект запроса
$request = new \AtolOnlineClient\Request\V4\PaymentReceiptRequest();
$paymentReceiptRequest = $atol->serializeOperationRequest($request);

$response = $atol->getApi()->sell($paymentReceiptRequest);

if ($response) {
    $postOperationResponse = $atol->deserializeOperationResponse($response);
}