1
0
mirror of synced 2024-11-21 20:46:03 +03:00
PHP API client for Atol Online
Go to file
2019-08-26 12:04:00 +03:00
src/AtolOnlineClient Fix vats request (#11) 2019-08-26 12:04:00 +03:00
tests Remove V3 (#8) 2019-08-22 17:04:26 +03:00
.gitignore Update guzzle to guzzlehttp/guzzle": "~6.3" 2019-07-24 17:13:55 +03:00
.travis.yml Update guzzle to guzzlehttp/guzzle": "~6.3" 2019-07-24 17:13:55 +03:00
composer.json phpunit ~7.0 2019-07-24 17:39:11 +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-07-24 17:48:07 +03:00

Build Status Latest stable

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