public function it_should_not_create_pdf_document_already_created(PdfDocument $doc)
 {
     $this->intent->getPaymentMethod()->willReturn(SepaOfflinePaymentMethod::ID);
     $this->event->getDocument()->willReturn($doc);
     $this->event->setDocument(Argument::Type('ZendPdf\\PdfDocument'))->shouldNotBeCalled();
     $this->event->stopPropagation()->shouldNotBeCalled();
     $this->generate($this->event);
 }
 /**
  * run immediate payment for spot sell tunnel
  *
  * @param  Intent                                    $intent
  * @return Symfony\Component\HttpFoundation\Response
  * @since  2.0.0
  */
 protected function handlePay(Intent $intent)
 {
     //find used PaymentMethod and send if
     $paymentMethod = $this->discovery->getMethod($intent->getPaymentMethod());
     $this->container->get('event_dispatcher')->dispatch(Ev\DonateEvents::PAYMENT_REQUESTED, new Ev\PaymentRequestedEvent($intent));
     return $paymentMethod->pay($intent);
 }