retailcrm / atol-online-client
PHP API client for ATOL Online
Installs: 396 944
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 4
Forks: 7
Open Issues: 1
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- doctrine/cache: ~1.6
- guzzlehttp/guzzle: ~6.3|^7.0
- jms/serializer: ^0.12|^1.0|^2.0|^3.0
- psr/log: ~1.0|^2.0|^3.0
- symfony/validator: ~2.8|~3.0|~4.0|^5.0|^6.0
Requires (Dev)
- phpunit/phpunit: ~8.0
README
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); }