cancel
Showing results for 
Search instead for 
Did you mean: 

PayPal Standard Controller Rewrite https issue

PayPal Standard Controller Rewrite https issue

I had overridden the PayPal standard controller (Magento enterprise 1.13) to change the status of the successful orders to "Processing". It worked fine in the development environment (sandbox paypal) but "http".

 

The same functionality did not work in live(sandbox paypal). This was with "https".

 

First it threw "General lock wait timeout error". So I increased the value to 300 which was set in development environment as well and my functionality worked. Presuming this could be the issue I increased the value.

 

But after that it is showing peculiar behavior in "https" - sandbox paypal. It is throwing 502 bad gateway error for few orders after looping for a long time. Otherwise it is generating error report.

 

Pl find below my success action:

 

public function  successAction()
    {
        $session = Mage::getSingleton('checkout/session');
        $session->setQuoteId($session->getPaypalStandardQuoteId(true));
        $order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId());
        $state = Mage_Sales_Model_Order::STATE_PROCESSING;
        $order-> setState($state);
        $order-> setStatus('processing');
        $order-> addStatusHistoryComment();
        $order-> save();
        Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();
        $this->_redirect('checkout/onepage/success', array('_secure'=>true));
    }

 

Has anyone overriden the paypal controllers and faced any issue. Any help as a hint even would be greatly appreciated.

 

 

1 REPLY

Re: PayPal Standard Controller Rewrite https issue

Just to clarify, have you tried testing without your controller override? i.e. can you confirm whether or not you get this behaviour with the default PayPal functionality? It might just be server config-related rather than your customisations.