protected function checkPreconditions($action, $data)
 {
     try {
         if (!$this->checkMD5($action, $data)) {
             throw new YandexKassaException($this->createData(self::CODE_AUTH_ERROR, $data, 'Неверный md5'));
         }
         $errorMessage = $this->orderService->checkOrder($data['customerNumber'], $data['orderNumber']);
         if (!empty($errorMessage)) {
             throw new YandexKassaException($this->createData(self::CODE_DECLINED, $data, $errorMessage));
         }
         return $this->createData(self::CODE_SUCCESS, $data);
     } catch (YandexKassaException $e) {
         if (!empty($this->logger)) {
             $this->logger->write($e->getData());
         }
         throw $e;
     }
 }