/**
  * @Extra\Route(
  *   "/recurring_payment_details/{gatewayName}/agreement/{agreementId}/payment/{paymentId}",
  *   name="acme_payex_recurring_payment_details"
  * )
  *
  * @Extra\Template
  */
 public function viewRecurringPaymentDetailsAction(Request $request, $gatewayName, $agreementId, $paymentId)
 {
     $payment = $this->getPayum()->getGateway($gatewayName);
     $payment->execute($syncAgreement = new Sync(new Identificator($agreementId, 'Acme\\PaymentBundle\\Model\\AgreementDetails')));
     $payment->execute($agreementStatus = new GetBinaryStatus($syncAgreement->getModel()));
     $paymentStatus = new GetBinaryStatus(new Identificator($paymentId, 'Acme\\PaymentBundle\\Model\\PaymentDetails'));
     $payment->execute($paymentStatus);
     $cancelToken = null;
     if ($paymentStatus->isCaptured()) {
         $cancelToken = $this->getTokenFactory()->createToken($gatewayName, $paymentStatus->getModel(), 'acme_payex_cancel_recurring_payment', array(), $request->attributes->get('_route'), $request->attributes->get('_route_params'));
     }
     return array('cancelToken' => $cancelToken, 'agreementStatus' => $agreementStatus, 'paymentStatus' => $paymentStatus);
 }