1. Go to this page and download the library: Download krasfree/atol-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
krasfree / atol-client example snippets
// создаем товарную позицию
$item = new Item();
$item->setName('Наименование товара')
->setPrice(2000)
->setQuantity(1)
->setAmount(2000)
->setTax(new Tax(Tax::TYPE_VAT0, 0))
->setPaymentMethod(Item::PAYMENT_METHOD_FULL_PAYMENT)
->setPaymentObject(Item::PAYMENT_OBJECT_COMMODITY);
// запрос на печать чека
$sell = new SellRequest(SellRequest::TYPE_SELL);
$sell->setTaxationType(SellRequest::TAX_TYPE_USN_INCOME)
->setElectronically(false)
->setClientInfo(new ClientInfo('[email protected]'))
->setItems([$item])
->setPayments([new Payment(Payment::PAYMENT_TYPE_ELECTRONICALLY, $order->total)])
->setTotal(2000);
$client = new AtolClient(new Client(), new Connection());
//$client->setLogger(LoggerInterface);
$response = $client->sendRequest(new CashRequest($sell));
// получаем результат запроса
$response->getStatusCode();
$response->getContents();
// возврат чека происходит так-же как и печать, только операция возврат
$sell = new SellRequest(SellRequest::TYPE_SELL_RETURN);
$request = new CashRequest(new CloseShiftRequest());
$response = $client->sendRequest($request);
$request = new CashRequest(new ReportXRequest());
$response = $client->sendRequest($request);
$response = $client->checkStatus('uuid задания');
// получаем результат запроса
$response->getStatusCode();
$response->getContents();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.