when using Paypal Express Checkout, after authenticating in Paypal sandbox, browser is redirected to "/paypal/express/review/" that shows a page to confirm order... then I press a button called "Place Order" and the order is placed because Paypal funds are decreased by the order amount. Then browser is redirected to /checkout/onepage/success/ from Paypal, but immediately is redirected to /checkout/onepage/failure.
When I see the successAction of OnePageController, I saw this:
public function successAction()
{
$session = $this->getOnepage()->getCheckout();
if (!$session->getLastSuccessQuoteId()) {
$this->_redirect('checkout/cart');
return;
}
$lastQuoteId = $session->getLastQuoteId();
$lastOrderId = $session->getLastOrderId();
$lastRecurringProfiles = $session->getLastRecurringProfileIds();
if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) {
$this->_redirect('checkout/cart');
return;
}
$session->clear();
$this->loadLayout();
$this->_initLayoutMessages('checkout/session');
Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
$this->renderLayout();
}
There is no a redirect to Failure action.
On the other hand, order is kept in "Payment Review" state and the invoice in "Pending" state.
Finally, I tell you that I have developed an observer that is called on "sales_order_invoice_pay" event. This event is called, even when the invoice remains in pending state.
What may this be causing this failure? when should orderbecome in "Complete" state?
Regards Jaime