1
0
mirror of synced 2024-11-21 20:46:03 +03:00
PHP API client for Atol Online
Go to file
2021-05-27 12:06:51 +03:00
src/AtolOnlineClient change quantity type from int to float (#14) 2021-05-27 12:06:51 +03:00
tests change quantity type from int to float (#14) 2021-05-27 12:06:51 +03:00
.gitignore Update guzzle to guzzlehttp/guzzle": "~6.3" 2019-07-24 17:13:55 +03:00
.travis.yml Update jms serializer (#12) 2019-12-26 11:36:15 +03:00
composer.json Update jms serializer (#12) 2019-12-26 11:36:15 +03:00
LICENSE Added LICENSE 2018-06-22 12:38:35 +03:00
phpunit.xml.dist Update guzzle to guzzlehttp/guzzle": "~6.3" 2019-07-24 17:13:55 +03:00
README.md Update README.md 2019-12-26 11:36:49 +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);
}