/**
  * @param Attendee $attendee
  */
 public function registerPayment(Attendee $attendee)
 {
     $attendee->setStatus(Attendee::WAITING_PAYMENT);
     $this->registrationService->createPayment($attendee, '');
     $this->paymentService->approvePayment($attendee->getLastPayment(), false);
     $this->confirm($attendee);
 }
 /**
  * @param Attendee $attendee
  * @param string $redirectTo
  * @return array
  */
 public function createPayment(Attendee $attendee, $redirectTo)
 {
     $payment = $this->paymentManager->create($this->costCalculator->getCost($attendee, new DateTime()), $this->getItemDescription($attendee->getEvent()));
     $this->attendeeManager->appendPayment($attendee, $payment);
     if ($attendee->getEvent()->isLateRegistrationPeriod($payment->getCreationTime())) {
         return array('data' => array('id' => $attendee->getId(), 'redirectTo' => $redirectTo));
     }
     $paymentResponse = $this->paymentManager->requestPayment($payment, $attendee->getUser()->getEmail(), $redirectTo);
     //TODO Refactor this!
     return array('data' => array('id' => $attendee->getId(), 'redirectTo' => $paymentResponse->getRedirectionUrl()));
 }