|
3 | 3 | namespace igorbunov\Checkbox; |
4 | 4 |
|
5 | 5 | use GuzzleHttp\Client; |
6 | | -use igorbunov\Checkbox\Errors\AlreadyOpenedShift; |
7 | | -use igorbunov\Checkbox\Errors\BadRequest; |
8 | 6 | use igorbunov\Checkbox\Errors\BadRequestExceptionFactory; |
9 | 7 | use igorbunov\Checkbox\Errors\EmptyResponse; |
10 | 8 | use igorbunov\Checkbox\Errors\InvalidCredentials; |
11 | | -use igorbunov\Checkbox\Errors\NoActiveShift; |
12 | 9 | use igorbunov\Checkbox\Errors\Validation; |
13 | 10 | use igorbunov\Checkbox\Mappers\Cashier\CashierMapper; |
14 | 11 | use igorbunov\Checkbox\Mappers\CashRegisters\CashRegisterInfoMapper; |
|
51 | 48 | use igorbunov\Checkbox\Models\Transactions\Transactions; |
52 | 49 | use igorbunov\Checkbox\Models\Transactions\TransactionsQueryParams; |
53 | 50 | use Psr\Http\Message\ResponseInterface; |
54 | | -use Psr\Http\Message\StreamInterface; |
55 | 51 |
|
56 | 52 | class CheckboxJsonApi |
57 | 53 | { |
@@ -99,7 +95,9 @@ public function __construct(Config $config, int $connectTimeoutSeconds = 5) |
99 | 95 | 'connect_timeout' => $this->connectTimeout, |
100 | 96 | 'headers' => [ |
101 | 97 | 'Content-Type' => 'application/json', |
102 | | - 'X-License-Key' => $this->config->get('licenseKey') |
| 98 | + 'X-License-Key' => $this->config->get(Config::LICENSE_KEY), |
| 99 | + 'X-Client-Name' => $this->config->get(Config::HEADER_CLIENT_NAME), |
| 100 | + 'X-Client-Version' => $this->config->get(Config::HEADER_CLIENT_VERSION), |
103 | 101 | ] |
104 | 102 | ]; |
105 | 103 | } |
@@ -586,14 +584,10 @@ public function getAllTaxes(): ?GoodTaxes |
586 | 584 |
|
587 | 585 | public function createXReport(): ?ZReport |
588 | 586 | { |
589 | | - $options = $this->requestOptions; |
590 | | - $options['headers']['X-Client-Name'] = 'Igorbunov Custom SDK'; |
591 | | - $options['headers']['X-Client-Version'] = '1.0.0'; |
592 | | - |
593 | 587 | $response = $this->sendRequest( |
594 | 588 | self::METHOD_POST, |
595 | 589 | $this->routes->createXReport(), |
596 | | - $options |
| 590 | + $this->requestOptions |
597 | 591 | ); |
598 | 592 |
|
599 | 593 | $jsonResponse = json_decode($response->getBody()->getContents(), true); |
|
0 commit comments