Question

I am using the payment gateway InnovatePayments which is working fine for single checkout & redirected me to Payment Gateway page after clicking place order button where i entered credit card info but for Checkout with Multiple Addresses (Even with same address but in multiple checkout option) magento is not able to redirected me to gateway page after clicking on place order below message is shown with order number.

"Thank you for your purchase!

We are processing your order and you will soon receive an email with details of the order. Once the order has shipped you will receive another email with a link to track its progress."

Thanks

Was it helpful?

Solution

I've hit a similar brick wall once.
After digging in the code I found that you cannot use payment methods that required a redirect to the payment gateway in multishipping checkout. I may be wrong here, but here is the reasons of my conclusion.

In the onepage checkout, when saving the order Mage_Checkout_OnepageController::saveOrderAction there is this code:

$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();
.....
if (isset($redirectUrl)) {
    $result['redirect'] = $redirectUrl;
}
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

and in opcheckout.js in the review class there is this:

if (response.redirect) {
    this.isSuccess = true;
    location.href = response.redirect;
    return;
}

So if there is a redirect url specified you will get redirected to that url.

There is something similar in the savePaymentAction.

I found no trace of something like that in the MultishippingController. take a look at what overviewPostAction does. (that's where the payment is processed).
After saving a few details about the credit card type (if applicable) this is called.

$this->_getCheckout()->createOrders();

The main attraction in the createOrders method is

foreach ($orders as $order) {
   $order->place();
   $order->save();
   if ($order->getCanSendNewEmailFlag()){
       $order->sendNewOrderEmail();
   }
   $orderIds[$order->getId()] = $order->getIncrementId();
}

So nothing about any redirect.

An other thing that made me reach this conclusion is that most of the online payment methods that Magento has by default are not allowed in the multishipping checkout.

Look in the code for the variable $_canUseForMultishipping. It is set to false for most of the online payment methods.

I guess the safest solution would be to disable your method for multishipping.

You can do that by adding

protected $_canUseForMultishipping = false;

to the model that handles the payment method.
I ended up doing the same in my case.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top