Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function forward($scenarioAlias, $stepName)
 {
     $process = $this->buildProcess($scenarioAlias);
     $step = $process->getStepByName($stepName);
     $this->context->initialize($process, $step);
     $this->context->rewindHistory();
     return $this->processStepResult($process, $this->context->isValid() ? $step->forwardAction($this->context) : $this->context->getProcess()->getValidator()->getResponse($step));
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function displayAction(ProcessContextInterface $context)
 {
     $order = $this->getCurrentCart();
     $this->dispatchCheckoutEvent(SyliusCheckoutEvents::PURCHASE_INITIALIZE, $order);
     /** @var $payment PaymentInterface */
     $payment = $order->getPayments()->last();
     $captureToken = $this->getTokenFactory()->createCaptureToken($payment->getMethod()->getGateway(), $payment, $context->getProcess()->getForwardRoute(), array('stepName' => $this->getName()));
     return new RedirectResponse($captureToken->getTargetUrl());
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function forward($scenarioAlias, $stepName)
 {
     $process = $this->buildProcess($scenarioAlias);
     $step = $process->getStepByName($stepName);
     $this->context->initialize($process, $step);
     try {
         $this->context->rewindHistory();
     } catch (NotFoundHttpException $e) {
         return $this->goToLastValidStep($process, $scenarioAlias);
     }
     return $this->processStepResult($process, $this->context->isValid() ? $step->forwardAction($this->context) : $this->context->getProcess()->getValidator()->getResponse($step));
 }