Example #1
0
 /**
  * Persists the new ticket
  *
  * @param string $transactionId
  * @param string $payerId
  * @param string $payerEmail
  */
 protected function persistance($transactionId, $payerId, $payerEmail)
 {
     $this->session->remove(self::PAYPAL_TOKEN);
     $ticket = $this->repository->createTicketFromPayment();
     $ticket->setTransactionInfo(['transactionId' => $transactionId, 'payerId' => $payerId, 'payerEmail' => $payerEmail]);
     // save payment
     try {
         $this->repository->persistNewPayment($ticket);
     } catch (\Exception $e) {
         $this->logger->error(sprintf('Payment was not saved for user %s transaction %s (reason: %s)'), $this->getUser()->getUsername(), $transactionId, $e->getMessage());
     }
 }
Example #2
0
 /**
  * @expectedException \RuntimeException
  */
 public function testCreateTicketWithoutProperConfig()
 {
     $ticket = $this->sut->createTicketFromPayment();
 }