1
0
mirror of synced 2024-11-21 20:46:03 +03:00
PHP API client for Atol Online
Go to file
Ilyas Salikhov df1543abd3
Merge pull request #1 from linniksa/sf
add symfony versions other that 2.8
2018-11-26 19:41:01 +03:00
src/AtolOnlineClient fix type string VatReceiptRequest.sum 2018-08-06 17:33:40 +03:00
tests/AtolOnlineClient/Tests немного тестов 2018-06-22 09:21:30 +03:00
.gitignore удалил composer.lock 2018-06-28 10:33:34 +03:00
bootstrap.php немного тестов 2018-06-22 09:21:30 +03:00
composer.json add symfony versions other that 2.8 2018-11-26 14:57:28 +03:00
LICENSE Added LICENSE 2018-06-22 12:38:35 +03:00
phpunit.xml.dist немного тестов 2018-06-22 09:21:30 +03:00
README.md Updated README 2018-06-28 10:44:21 +03:00

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

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

Требования

  • PHP 7.1 и выше
  • 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);
}