Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SuccessValidator.php
Go to the documentation of this file.
1 <?php
7 
15 {
19  protected $checkoutSession;
20 
25  public function __construct(
26  \Magento\Checkout\Model\Session $checkoutSession
27  ) {
28  $this->checkoutSession = $checkoutSession;
29  }
30 
34  public function isValid()
35  {
36  if (!$this->checkoutSession->getLastSuccessQuoteId()) {
37  return false;
38  }
39 
40  if (!$this->checkoutSession->getLastQuoteId() || !$this->checkoutSession->getLastOrderId()) {
41  return false;
42  }
43  return true;
44  }
45 }
__construct(\Magento\Checkout\Model\Session $checkoutSession)