magento custom gateaway payment redirect is 404
I made a custom payment gateaway for asurepay. It's like paypal standard payment for short. In place my order and it will redirect to a redirect page of my module, here is the problem. It gives me a 404 page.
Here is my file structure. (In case you need to study)
- app/
- code/
- local/
- Asurepay/
- Custompay/
- Model/
- Asure.php
- Block/
- Asure/
-Redirect.php
- Form.php
- Info.php
- etc/
- config.xml
- system.xml
- design/
- adminhtml/
- ......
- frontend/
- default/
- default/
- template/
- custompay/
- asurepay/
- redirect.phtml
开发者_如何学运维 - form.phtml
- etc/
- modules/
- Asurepay_Custompay.xml
Here is my Model/Asure redirect code:
public function getOrderPlaceRedirectUrl() {
return Mage::getUrl('custompay/asurepay/redirect', array('_secure' => true));
}
Here is my config.xml as requested
<config>
<modules>
<Asurepay_Custompay>
<version>0.1.0</version>
</Asurepay_Custompay>
</modules>
<global>
<blocks>
<custompay>
<class>Asurepay_Custompay_Block</class>
</custompay>
</blocks>
<models>
<custompay>
<class>Asurepay_Custompay_Model</class>
</custompay>
</models>
<resources>
<custompay_setup>
<setup>
<module>Asurepay_Custompay</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</custompay_setup>
<custompay_write>
<connection>
<use>core_write</use>
</connection>
</custompay_write>
<custompay_read>
<connection>
<use>core_read</use>
</connection>
</custompay_read>
</resources>
</global>
<default>
<payment>
<custompay>
<active>1</active>
<model>custompay/asure</model>
<order_status>pending</order_status>
<title>AsurePay</title>
<gateurl>https://www.paymentUrl.com/payment/</gateurl>
<successurl>{{base_url}}</successurl>
<redimsg>You will be redirected to the payment website when you place an order.</redimsg>
<allowspecific>0</allowspecific>
</custompay>
</payment>
</default>
</config>
Obviously the redirect url is:
www.mydomain.com/custompay/asurepay/redirect/
This url gives me a 404 page.
How can I tell magento to create a redirect page so it will not be 404 or how can i make the www.mydomain.com/custompay/asurepay/redirect/ page via controller.?
Ask me if you need more info. :) thanks a lot.
you need to define frontend router for your extension and probably also layout references , the issue is there that you don't have controller access defined for frontend
<frontend>
<routers>
<custompay>
<use>standard</use>
<args>
<module>Asurepay_Custompay</module>
<frontName>custompay</frontName>
</args>
</custompay>
</routers>
</frontend>
精彩评论