PHP code example of kolirt / checkbox.in.ua-sdk

1. Go to this page and download the library: Download kolirt/checkbox.in.ua-sdk 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/ */

    

kolirt / checkbox.in.ua-sdk example snippets


$checkbox = new Checkbox([
    'production'  => false,
    'license_key' => 'as1c9e4s8618d6d4fb5c22a0'
]);


$checkbox->singInCashier('login', 'password');

$checkbox->signOutCashier();

$checkbox->createShift();

$checkbox->closeShift();

$receipt = new Receipt;

// create good
$good = new ReceiptGood;
$good->setCode('pizza-1');
$good->setName('Піца Гавайська');
$good->setQuantity(1 * 1000);
$good->setPrice(114 * 100);
$receipt->adGood($good);

// create discount
$discount = new ReceiptDiscount;
$discount->setType(ReceiptDiscount::TYPE_DISCOUNT);
$discount->setMode(ReceiptDiscount::MODE_VALUE);
$discount->setValue(4 * 100);
$receipt->addDiscount($discount);

// create payment
$payment = new ReceiptPayment;
$payment->setType(ReceiptPayment::TYPE_CASHLESS);
$payment->setValue((114 - 4) * 100);
$receipt->addPayment($payment);

$receiptResponse = $checkbox->createReceipt($receipt);

$response = $checkbox->getReceiptHtml('16b03682-11bc-20fb-17fa-43749b4a3c5s');

$response = $checkbox->getReceiptPdf('16b03682-11bc-20fb-17fa-43749b4a3c5s');

$response = $checkbox->getReceiptText('16b03682-11bc-20fb-17fa-43749b4a3c5s');

$response = $checkbox->getReceiptQrcode('16b03682-11bc-20fb-17fa-43749b4a3c5s');