PHP code example of unetway / atol

1. Go to this page and download the library: Download unetway/atol 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/ */

    

unetway / atol example snippets

`
use Unetway\Atol\Atol;

$atol = new Atol([
    'login' => '',
    'password' => '',
    'group_code' => '',
    'company_email' => '',
    'sno' => '',
    'inn' => '',
    'payment_address' => '',
    'is_test' => false,
    'callback_url' => '',
    'vat' => 'vat20',
]);

$name = 'Имя';
$email = '[email protected]';
$price = 700;

return $atol->receipt($name, $price, $email);

`
use Unetway\Atol\Atol;

$atol = new Atol([
    'login' => '',
    'password' => '',
    'group_code' => '',
    'company_email' => '',
    'sno' => '',
    'inn' => '',
    'payment_address' => '',
    'is_test' => false,
    'callback_url' => '',
    'vat' => 'vat20',
]);
$uuid = '';

return $atol->report($uuid);

`
$request = file_get_contents('php://input');
$res = json_decode($request, true);
$uuid = $res['uuid'];

if ($res['status'] !== 'done') {
    
}