I'm having a problem with product checkout in M2. When I want to place the order, a success page must be displayed, but I got redirected to the view cart page, and the item is still in the cart. I have traced it down to app/code/Magento/Checkout/Controller/Onepage/Success.php
and find out this piece of code:
if (!$this->_objectManager->get('Magento\Checkout\Model\Session\SuccessValidator')->isValid()) {
return $this->resultRedirectFactory->create()->setPath('checkout/cart');
}
and in app/code/Magento/Checkout/Model/Session/Validator.php
public function isValid()
{
if (!$this->checkoutSession->getLastSuccessQuoteId()) {
return false;
}
if (!$this->checkoutSession->getLastQuoteId() || !$this->checkoutSession->getLastOrderId()) {
return false;
}
return true;
}
What could be the cause to this?