Php magento自定义付款方式重定向
我正在尝试建立自定义付款方法。它应该像paypal一样工作,当用户点击“下订单”时,它应该在外部gatewey上重定向他。诀窍在于它必须发送POST数据 为了创建模块,我提供了一些教程,但主要是这一个 Model/Standard.phpPhp magento自定义付款方式重定向,php,magento,redirect,paypal,payment-gateway,Php,Magento,Redirect,Paypal,Payment Gateway,我正在尝试建立自定义付款方法。它应该像paypal一样工作,当用户点击“下订单”时,它应该在外部gatewey上重定向他。诀窍在于它必须发送POST数据 为了创建模块,我提供了一些教程,但主要是这一个 Model/Standard.php public function getOrderPlaceRedirectUrl() { Mage::Log('Called ' . __METHOD__); return Mage::getUrl('payment/Standar
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,但它并没有执行重定向操作。谁能帮我解决这个问题,我是magento的新手
controllers/StandardController.php
public function redirectAction()
{
Mage::Log('Called ' . __METHOD__);
//do something
}
Block/Standard/Redirect.php
protected function _toHtml()
{
Mage::Log('Called ' . __METHOD__);
//do POST
}
Phtml文件不应该是这里的问题。在本教程中,控制器的注册方式如下:
<frontend>
<routers>
<mycheckout>
<use>standard</use>
<args>
<module>Inchoo_Mycheckout</module>
<frontname>customcard</frontname>
</args>
</mycheckout>
</routers>
</frontend>
标准
仁寿美酒店
海关卡
同时将
'customcard/standard/redirect'
改为小写。如果您需要进一步的支持并更改了模块和类名,请将它们添加到您的问题中。您是否为url创建了所需的控制器?在您的教程中,它读到“如果您的方法在客户点击结帐按钮时重定向,请下订单,您必须使用方法重定向操作等创建(customcard/standard/redirect)标准控制器”!我在Controller folder中创建了StandardController.php。请展示如何在config.xml中注册。确保在添加缓存后清除了缓存。我没有显式注册控制器。我看了paypal配置,没有发现任何类似的东西。我是否应该注册控制器以及如何注册?我没有为块创建phtml,这可能是个问题吗?这并不完全是这个问题,而是关于名称空间的问题。对于所有有相同问题的人,请特别注意名称空间,尤其是小写或大写字符。