in Mage/Paypal/controllers/StandardController there is such method as successAction, which finaly redirects you to checkout/success/onepage
/**
* when paypal returns
* The order information at this point is in POST
* variables. However, you don't want to "process" the order until you
* get validation from the IPN.
*/
public function successAction()
{
$session = Mage::getSingleton('checkout/session');
$session->setQuoteId($session->getPaypalStandardQuoteId(true));
Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();
$this->_redirect('checkout/onepage/success', array('_secure'=>true));
}
In HostedproController there no successAction, there is only returnAction
/**
* When a customer return to website from gateway.
*/
public function returnAction()
{
$session = $this->_getCheckout();
//TODO: some actions with order
if ($session->getLastRealOrderId()) {
$this->_redirect('checkout/onepage/success');
}
}