1
0
mirror of synced 2024-11-24 05:56:06 +03:00
PHP API client for Atol Online
Go to file
2024-01-27 19:36:37 +03:00
src/AtolOnlineClient change quantity type from int to float (#14) 2021-05-27 12:06:51 +03:00
tests Environment to run test locally 2024-01-27 19:36:37 +03:00
.gitignore Update guzzle to guzzlehttp/guzzle": "~6.3" 2019-07-24 17:13:55 +03:00
.travis.yml fix jms/serializer versions (#15) 2021-10-29 12:39:14 +03:00
composer.json bump "symfony/validator" version in composer.json (#16) 2022-09-05 13:45:33 +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 Update guzzle to guzzlehttp/guzzle": "~6.3" 2019-07-24 17:13:55 +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);
}