tdev-agency/checkbox-ua

0.0.1 2022-07-15 07:57 UTC

This package is auto-updated.

Last update: 2024-10-15 13:46:27 UTC


README

PHP SDK for Checkbox.ua

  1. Installation
  2. Usage
  3. Cashier
    1. Completion of the session of a cashier with the current access token
    2. Getting information about the current user (cashier)
    3. Receiving information about an active change of user (cashier)
    4. Check signature
  4. Organization
    1. Get current organization receipt settings
    2. Get current organization logo
    3. Get current organization text logo
  5. Shifts
    1. [Creating a Z-Report and closing the current shift by the user (cashier)](Creating a Z-Report and closing the current shift by the user (cashier))
    2. Opening a new shift by a cashier
    3. Getting current cashier shifts
    4. Receiving information about the current shift

Installation

The recommended way to install Guzzle is through Composer.

composer require tdev-agency/checkbox-ua

Usage

Create SignIn entity:

  1. SignIn with login and password:
$entity = \TDevAgency\CheckboxUa\Entities\Requests\SignInRequestEntity::create([
            'login' => 'login',
            'password' => 'password',
            'license_key' => 'license_key'
]);
  1. SignIn with pin code:
$entity = \TDevAgency\CheckboxUa\Entities\Requests\SignInRequestEntity::create([
            'pin_code' => 'pin_code',
            'license_key' => 'license_key'
]);

Initialize checkbox.ua instance

// For pin code sign in
$client = new CheckboxUa(CheckboxUa::DRIVER_SIGNIN_PIN_CODE, $entity);
// For sign in with login and password
$client = new CheckboxUa(CheckboxUa::DRIVER_SIGNIN, $entity);

Tags of api endpoints

Tags based on the official documentation of the checkbox.ua

There are two ways to call required tag.

E.g.: $cashier = $client->getCashier(); or by using helper method $cashier = $client->make(\TDevAgency\CheckboxUa\Tags\Cashier::class);

Cashier

Completion of the session of a cashier with the current access token

$client->getCashier()->signOut()

Getting information about the current user (cashier)

$client->getCashier()->me()

Receiving information about an active change of user (cashier)

$client->getCashier()->shift()

Check signature

$client->getCashier()->checkSignature()

Organization

Get current organization receipt settings

$client->make(\TDevAgency\CheckboxUa\Tags\Organization::class)->receiptConfig()

Get current organization logo

$client->make(\TDevAgency\CheckboxUa\Tags\Organization::class)->logoPng()

Get current organization text logo

$client->make(\TDevAgency\CheckboxUa\Tags\Organization::class)->textLogoPng()

Shifts

Creating a Z-Report and closing the current shift by the user (cashier)

$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->closeShift()

Optionally, a Z-Report can be generated on the client side and passed in the body of this request

$entity = \TDevAgency\CheckboxUa\Entities\Requests\ShiftCloseRequestEntity::create($data)
$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->closeShift($entity)

$data values:

Opening a new shift by a cashier

$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->createShift($id, $fiscal_code, $fiscal_date)

Getting current cashier shifts

$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->getShifts($statuses, $limit, $offset, $desc)

Receiving information about the current shift

$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->getShift($id, $options)

Receipts

Obtaining a list of checks within the current shift or according to filter parameters

$entity = \TDevAgency\CheckboxUa\Entities\Requests\ReceiptQueryRequestEntity::create($data)
$client->getReceipts()->index($requestEntity)

$data params for ReceiptQueryRequestEntity:

TODO

  1. Create Receipt
  2. Get Receipt Html
  3. Webhooks