cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Access Quote from checkout session after returning from payment Gateway

Can't Access Quote from checkout session after returning from payment Gateway

Hello Friends,

I am building payment gateway extension and i am facing small issue to get the quote object after control return from payment Gateway.

 

Let me explain you in detail.

I am using below funtion to redirect to payment gateway.

public function getCheckoutRedirectUrl()
{
return Mage::getUrl('custom/index/start');
}

Above method works fine. I am redirecting to payment gateway and payment processed successful with success message and redirect back to our store with captured status on below controller action.

public function returnAction()
{
$quote = Mage::getSingleton('checkout/session')->getQuote();
$quote->collectTotals();
$payment = $quote->getPayment();
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$quote->save();
$order = $service->getOrder();
$this->getSession()->setLastQuoteId($quote->getId())
->setLastSuccessQuoteId($quote->getId())
->setLastOrderId($order->getId());
{
		
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT:
break;
case Mage_Sales_Model_Order::STATE_PROCESSING:
case Mage_Sales_Model_Order::STATE_COMPLETE:
case Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW:
$order->sendNewOrderEmail();
break;
}
$this->getResponse()->setRedirect(Mage::getUrl('checkout/onepage/success'));
return;
}

But in the above function i get the quote object as blank and due to that i am unable to place an order. This means that after returning from payment gateway it clears the checkout session.


How can i get the quote object and what is the problem ?

Please help

 

Thanks for your answer in advance.

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.
2 REPLIES 2

Re: Can't Access Quote from checkout session after returning from payment Gateway

I am facing the same issue as mentioned above. can anyone help me ?

Re: Can't Access Quote from checkout session after returning from payment Gateway

Do you get solution or still looking for this?

Was my answer helpful? You can Click Kudos/Accept As Solution.
200+ professional extensions for M1 & M2 with free lifetime updates!