factory = new ReceiptResponseFactory(); if (!empty($response['type'])) { $this->type = $response['type']; } $this->items = array(); foreach ($response['items'] as $item) { if ($receipt = $this->factory->factory($item)) { $this->items[] = $receipt; } } if (!empty($response['next_cursor'])) { $this->nextCursor = $response['next_cursor']; } } /** * Возвращает формат выдачи результатов запроса. Возможное значение: `list` (список). * @return string Формат выдачи результатов запроса. */ public function getType() { return $this->type; } /** * Возаращает список чеков * @return ReceiptResponseInterface[] Список чеков */ public function getItems() { return $this->items; } /** * Возвращает токен следующей страницы, если он задан, или null * @return string|null Токен следующей страницы */ public function getNextCursor() { return $this->nextCursor; } /** * Проверяет имееотся ли в ответе токен следующей страницы * @return bool True если токен следующей страницы есть, false если нет */ public function hasNextCursor() { return $this->nextCursor !== null; } }