Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Start.php
Go to the documentation of this file.
1 <?php
7 
9 
13 class Start extends GetToken
14 {
21  public function execute()
22  {
23  try {
24  $token = $this->getToken();
25  if ($token === null) {
26  return;
27  }
28 
29  $url = $this->_checkout->getRedirectUrl();
30  if ($token && $url) {
31  $this->_initToken($token);
32  $this->getResponse()->setRedirect($url);
33 
34  return;
35  }
36  } catch (\Magento\Framework\Exception\LocalizedException $e) {
37  $this->messageManager->addExceptionMessage($e, $e->getMessage());
38  } catch (\Exception $e) {
39  $this->messageManager->addExceptionMessage(
40  $e,
41  __('We can\'t start Express Checkout.')
42  );
43  }
44 
45  $this->_redirect('checkout/cart');
46  }
47 }
_redirect($path, $arguments=[])
Definition: Action.php:167
__()
Definition: __.php:13