/**
  * {@inheritdoc}
  */
 public function capturePayment()
 {
     if (!$this->getPayment()) {
         throw new \LogicException('Trying to capture a non-existing payment. A payment must be set trough self::setPayment() first.');
     }
     $this->eventDispatcher->preCapturePayment($this->getPayment());
     $this->doCapturePayment();
     return $this->getPaymentCaptureResult();
 }