/**
  * @param ShopOrder $order
  * @return \skeeks\cms\shop\paySystems\robokassa\Merchant
  * @throws BadRequestHttpException
  */
 protected function getMerchant(ShopOrder $order)
 {
     /** @var \skeeks\cms\shop\paySystems\robokassa\Merchant $merchant */
     $paySystemHandler = $order->paySystem->paySystemHandler;
     if (!$paySystemHandler || !$paySystemHandler instanceof RobokassaPaySystem) {
         RobokassaPaySystem::logError('Not found pay system');
         throw new BadRequestHttpException('Not found pay system');
     }
     $merchant = $paySystemHandler->getMerchant();
     if (!$merchant instanceof Merchant) {
         RobokassaPaySystem::logError('Not found merchant');
         throw new BadRequestHttpException('Not found merchant');
     }
     return $merchant;
 }