magento自定义付款方式重定向

时间:2013-09-01 11:23:26

标签: php magento redirect paypal payment-gateway

我正在尝试构建自定义付款方式。它应该作为paypal工作,当用户cliks在“下订单”它应该重定向他在外部gatewey。诀窍是它必须发送POST数据。

要创建模块,我接受了严格的教程,但主要是这一篇Incho

型号/ Standard.php

   public function getOrderPlaceRedirectUrl()
   {
    Mage::Log('Called ' . __METHOD__);
    return Mage::getUrl('payment/Standard/Redirect', array('_secure' => true));
   }

点击程序后,它会重定向我

> http://192.168.0.15/magento/index.php/payment/Standard/Redirect

我得到404错误。在日志文件中我可以看到它命中方法getOrderPlaceRedirectUrl,但它没有来到redirectAction。任何人都可以帮我解决这个问题,我是magento的新手。

控制器/ StandardController.php

 public function redirectAction()
{       
 Mage::Log('Called ' . __METHOD__);
//do something
}

块/标准/ Redirect.php

protected function _toHtml()
{
Mage::Log('Called ' . __METHOD__);
    //do POST
}

1 个答案:

答案 0 :(得分:1)

Phtml文件不应该是这里的问题。在本教程中,控制器的注册如下:

   <frontend>
        <routers>
            <mycheckout>
                <use>standard</use>
                <args>
                    <module>Inchoo_Mycheckout</module>
                    <frontname>customcard</frontname>
                </args>
            </mycheckout>
        </routers>
    </frontend>

同时使'customcard/standard/redirect'小写。如果您需要进一步的支持并更改了模块和类名,请将它们添加到您的问题中。