PHP code example of gavan4eg / cashalotapi

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

    

gavan4eg / cashalotapi example snippets


$cashalot = new CashalotService();
var_dump($cashalot->transactionsRegistrarState());


$remove = true

$cashalot = new CashalotService();
var_dump($cashalot->cleanUp());

$cashalot = new CashalotService();
var_dump($cashalot->openShift());

// Формувати Z-Звіт коли закритя зміни true/false
$zrep = true;

$cashalot = new CashalotService();
var_dump($cashalot->closeShift($zrep));

// Праметри до внесення
/**
 * DOCSUBTYPE
 * 1. CheckGoods - регістрація чеку
 * 2. ServiceDeposit - службове внесеня
 * 3. ServiceIssue - службова видача
*/

$cashalot = new CashalotService();
$array = $cashalot->registerCheck([
            "CHECKHEAD" => [
                "DOCTYPE" => "SaleGoods",
                "DOCSUBTYPE" => "CheckGoods"
            ],
            "CHECKTOTAL" => [
                "SUM" => 99.99
            ],
            "CHECKPAY" => [
                [
                    "PAYFORMCD" => 1,
                    "PAYFORMNM" => "Банківська картка",
                    "SUM" => 99.99,
                    "PAYSYS" => [
                        [
                            "TAXNUM" => "UA2020",
                            "NAME" => "LiqPay",
                            "SUM" => "99.99",
                            "COMMISSION" => "0"
                        ]
                    ],
                ],
            ],
            "CHECKBODY" => [
                [

                    "NAME" => "Оплата за услуги клинки",
                    "UNITCD" => 138,
                    "UNITNM" => "л",
                    "AMOUNT" => 1.000,
                    "PRICE" => 99.99,
                    "COST" => 99.99
                ]
            ],
        ]);
        dd($array);


$cashalot = new CashalotService();
var_dump($cashalot->registerZRep());

php artisan vendor:publish

  "ZRepAutoInfo" => array:6 [
    "NumFiscal" => "1384622746"
    "NumLocal" => 290
    "OrderDateTime" => "2023-09-30T14:59:31.8089189+03:00"
    "Offline" => false
    "ErrorCode" => "Ok"
    "ErrorMessage" => null
  ]
  "NumFiscal" => "1384622754"
  "NumLocal" => 291
  "OrderDateTime" => "2023-09-30T14:59:31.9714893+03:00"
  "Offline" => false
  "ErrorCode" => "Ok"
  "ErrorMessage" => null
]

  "QrCode" => null
  "Url" => "https://cabinet.tax.gov.ua/cashregs/check?fn=4000146829&id=1384600901&date=20230930&time=145454&sm=99.99"
  "NumFiscal" => "1384600901"
  "NumLocal" => 289
  "OrderDateTime" => "2023-09-30T14:54:54.8878813+03:00"
  "Offline" => false
  "ErrorCode" => "Ok"
  "ErrorMessage" => null