1
0
mirror of synced 2024-11-21 12:46:01 +03:00
PHP API client for Atol Online
Go to file
2024-07-17 12:44:28 +03:00
src/AtolOnlineClient change quantity type from int to float (#14) 2021-05-27 12:06:51 +03:00
tests Compability with guzzlehttp/guzzle:^7.0 2024-01-27 19:37:04 +03:00
.gitignore Check deprecations in tests 2024-01-27 19:40:29 +03:00
.travis.yml fix jms/serializer versions (#15) 2021-10-29 12:39:14 +03:00
composer.json Resolve conflict with psr/log 2024-07-17 12:12:51 +03:00
docker-compose.yml Environment to run test locally 2024-01-27 19:36:37 +03:00
Dockerfile Environment to run test locally 2024-01-27 19:36:37 +03:00
LICENSE Added LICENSE 2018-06-22 12:38:35 +03:00
Makefile Environment to run test locally 2024-01-27 19:36:37 +03:00
phpunit.xml.dist Check deprecations in tests 2024-01-27 19:40:29 +03:00
README.md fix jms/serializer versions (#15) 2021-10-29 12:39:14 +03:00

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);
}