Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ShippingOptionsCallback.php
Go to the documentation of this file.
1 <?php
8 
10 {
14  protected $quoteRepository;
15 
27  public function __construct(
28  \Magento\Framework\App\Action\Context $context,
29  \Magento\Customer\Model\Session $customerSession,
30  \Magento\Checkout\Model\Session $checkoutSession,
31  \Magento\Sales\Model\OrderFactory $orderFactory,
32  \Magento\Paypal\Model\Express\Checkout\Factory $checkoutFactory,
33  \Magento\Framework\Session\Generic $paypalSession,
34  \Magento\Framework\Url\Helper\Data $urlHelper,
35  \Magento\Customer\Model\Url $customerUrl,
37  ) {
38  $this->quoteRepository = $quoteRepository;
39  parent::__construct(
40  $context,
41  $customerSession,
42  $checkoutSession,
43  $orderFactory,
44  $checkoutFactory,
45  $paypalSession,
46  $urlHelper,
48  );
49  }
50 
56  public function execute()
57  {
58  try {
59  $quoteId = $this->getRequest()->getParam('quote_id');
60  $this->_quote = $this->quoteRepository->get($quoteId);
61  $this->_initCheckout();
62  $response = $this->_checkout->getShippingOptionsCallbackResponse($this->getRequest()->getParams());
63  $this->getResponse()->setBody($response);
64  } catch (\Exception $e) {
65  $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
66  }
67  }
68 }
$response
Definition: 404.php:11
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Paypal\Model\Express\Checkout\Factory $checkoutFactory, \Magento\Framework\Session\Generic $paypalSession, \Magento\Framework\Url\Helper\Data $urlHelper, \Magento\Customer\Model\Url $customerUrl, \Magento\Quote\Api\CartRepositoryInterface $quoteRepository)
$customerUrl
Definition: info.phtml:28