PHP code example of diswebru / business-ru-open-api-sdk-php

1. Go to this page and download the library: Download diswebru/business-ru-open-api-sdk-php 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/ */

    

diswebru / business-ru-open-api-sdk-php example snippets



# Подключаем автозагрузку
Client
iClient = new OpenClient($this->account_url,$this->appID,$this->secret_key);
# Пример ссылки
# ФФД /v1/ - 1.05 /v2/ - 1.2
$this->account_url - "https://check.business.ru/open-api/v1/"


$openApiClient->getStateSystem();


$openApiClient->openShift();


$openApiClient->closeShift();


$command = [
    "author" => "Тестовый кассир",
    "smsEmail54FZ" => "[email protected]",
    "c_num" => "1111222333",
    "payed_cashless" => 1000,
    "goods" => [
        [
            "count" => 2,
            "price" => 500,
            "sum" => 1000,
            "name" => "Товар 1",
            "nds_value" => 20,
            "nds_not_apply" => false,
            "payment_mode" => 1,
            "item_type" => 1
        ]
    ]
];
$openApiClient->printCheck($command);


$command = [
    "author" => "Тестовый кассир",
    "smsEmail54FZ" => "[email protected]",
    "c_num" => "1111222333",
    "payed_cashless" => 1000,
    "goods" => [
        [
            "count" => 2,
            "price" => 500,
            "sum" => 1000,
            "name" => "Товар 1",
            "nds_value" => 20,
            "nds_not_apply" => false,
            "payment_mode" => 1,
            "item_type" => 1
        ]
    ]
];
$openApiClient->printPurchaseReturn($command);


$commandID = "command_id"
$openApiClient->dataCommandID($commandID);