Magento “place order” redirection for payment gate

2019-07-07 06:08发布

问题:

this is my first actual post on StackOverflow. I'm on here quite often because you guys always solve my queries!

We have a problem in a checkout cart on a Magento on localhost.

We have Magento version 1.5 and are using the direcpay payment module(Created the module manually by using the blog by roi smikes).

The problem appears when a customer adds products to their cart . When they click on the 'Place Order' button, they should be taken to a form in which the user have to enter customer detail field before redirecting to payment gateway like merchantid,name and address etc, in which they can send these information through url to the direcpay payment gateway.I dont know what to do next,should i have to make a new form in which these information should be entered and how the place order button can be handle.

Any help/advice/solution/anything! would be much appreciated!

Thanks!

回答1:

I suppose what you desire is as below

Click Place order ---> Customer Details Page -----> External payment gateway

Steps to achieve this

  1. modifty saveOrderAction() in the file app\code\core\Mage\Checkout\controllers\OnepageController.php

add this file code which checks what payment method was selected

    if($data['method']=='cashondelivery')
    {
        $redirectUrl='';
    }
    else
    {
        $redirectUrl = 'https://mysite.com/customer_details.php';
    }
  1. Add a proceed button in the customer_details.php page which now takes customer to bank website with the posted information