/** * @return bool */ public function isValid() { if (!$this->checkoutSession->getLastSuccessQuoteId()) { return false; } if (!$this->checkoutSession->getLastQuoteId() || !$this->checkoutSession->getLastOrderId()) { return false; } return true; }
/** * Is valid session? * * @param \Magento\Checkout\Model\Session $checkoutSession * @return bool */ public function isValid(\Magento\Checkout\Model\Session $checkoutSession) { if (!$checkoutSession->getLastSuccessQuoteId()) { return false; } if (!$checkoutSession->getLastQuoteId() || !$checkoutSession->getLastOrderId()) { return false; } return true; }
/** * Is valid session? * * @param \Magento\Checkout\Model\Session $checkoutSession * @return bool */ public function isValid(\Magento\Checkout\Model\Session $checkoutSession) { if (!$checkoutSession->getLastSuccessQuoteId()) { return false; } if (!$checkoutSession->getLastQuoteId() || !$checkoutSession->getLastOrderId() && count($checkoutSession->getLastRecurringPaymentIds()) == 0) { return false; } return true; }