You don't want to use any curl or server side stuff. This would mean the user submits his credentials to you and not the payment provider. Man in the middle
for free.
Have a look on the paypal redirect: \Mage_Paypal_Block_Standard_Redirect
.
Use a <form>
with all the informations and submit it with JavaScript
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.
Best Answer
hello nikhil it can be happen because you are not getting success from your payment gateway same happened with me while using paytm so you go to your gateway module (magento) first check that the url where you are getting redirected is written where because in payment gateways usually we have :- success, cancel, failure functions so for that you will come to know about please tell are you using dummy account of payment gateway for testing