# Перевірка стану замовлення

Якщо вам потрібно вручну перевірити поточний стан транзакції (наприклад, за кроном або якщо користувач закрив сторінку оплати), використовуйте клас `AlliancePay\Sdk\Payment\Order\CheckOrderData`.

#### Приклад перевірки статусу: <a href="#priklad-perevirki-statusu" id="priklad-perevirki-statusu"></a>

Для перевірки достатньо мати `hppOrderId` та об'єкт авторизації.

```php
use AlliancePay\Sdk\Payment\Order\CheckOrderData;

// 1. Ініціалізація сервісу перевірки
$checkService = new CheckOrderData();

// 2. Виклик методу перевірки
// Перший аргумент - ідентифікатор замовлення hppOrderId
// Другий аргумент - ваш збережений об'єкт AuthorizationDTO
try {
    /** @var AlliancePay\Sdk\Payment\Dto\Order\OrderDataResponseDTO $orderStatus */
    $orderStatus = $checkService->checkOrderData('HPP_ORDER_ID', $authDto);
} catch (\Exception $e) {
    echo "Помилка при перевірці статусу: " . $e->getMessage();
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.merchant.alb.ua/platizhni-vidzheti-dlya-cms/alliancepay-php-sdk/perevirka-stanu-zamovlennya.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
