0

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

0

Did you try to disable your custom observer and check once for make sure this error because of your customisation ? If that is bcoz of your custom observer then please debug your code and fix this and let me know if any help needed for that.

  • Yes... that problem occured also before adding the observer... I cannot debug the code.. the only way I think I can is by placing some log messages in the successAction, but this problem comes from Paypal Express extension. – jstuardo Mar 22 at 16:15
  • it is strange, but I have placed some log messages in /checkout/onepage/success/ and in /checkout/onepage/failure/ , and even when I see, using Development Tools, the URL /checkout/onepage/success/ being called, immediately I see a 302 HTTP response and calls /checkout/onepage/failure/. And also, I only see log messages from failure action. – jstuardo Mar 22 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.