Custom Payment Module not appearing in frontend during checkout
I'm having some issues with my custom payment module.
The problem is that whatever I try, I can't see the selection for my payment method in the frontend.
This might seem like a duplicate of similar questions, but I've already read them and the solutions didn't work out for me.
The setup
File tree:
/app/code/local/CatalystCode/EwirePayment/
-controllers/
--CallbackController.php
-etc/
--config.xml
-etc/
--system.xml
-Model/
--Payment.php
The content
config.xml:
<?xml version="1.0"?>
<config>
<modules>
<CatalystCode_EwirePayment>
<version>0.1.0</version>
</CatalystCode_EwirePayment>
</modules>
<global>
<resources>
<ewirepayment_setup>
<setup>
<module>CatalystCode_EwirePayment</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</ewirepayment_setup>
<ewirepayment_write>
<connection>
<use>core_write</use>
</connection>
</ewirepayment_write>
<ewirepayment_read>
<connection>
<use>core_read</use>
</connection>
</ewirepayment_read>
</resources>
<events>
<controller_front_init_routers>
<observers>
<CatalystCode_ewirepayment_model_observer>
<type>singleton</type>
<class>CatalystCode_EwirePayment_Model_Observer</class>
开发者_Go百科 <method>checkForConfigRequest</method>
</CatalystCode_ewirepayment_model_observer>
</observers>
</controller_front_init_routers>
</events>
<frontend>
<routers>
<ewirepayment>
<use>standard</use>
<args>
<module>CatalystCode_EwirePayment</module>
<frontName>ewirepayment</frontName>
</args>
</ewirepayment>
</routers>
</frontend>
</global>
<default>
<payment>
<ewirepayment>
<active>1</active>
<model>ewirepayment/payment</model>
<order_status>pending</order_status>
<title>Pay with Ewire</title>
</ewirepayment>
</payment>
</default>
</config>
system.xml:
<?xml version="1.0"?>
<config>
<sections>
<payment>
<groups>
<CatalystCode_EwirePayment>
<label>Ewire Payment</label>
<sort_order>670</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<fields>
<active translate="label">
<label>Enabled</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</active>
<company_id translate="label">
<label>CompanyID</label>
<frontend_type>text</frontend_type>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</company_id>
<encryption_key translate="label">
<label>Encryption key</label>
<frontend_type>text</frontend_type>
<sort_order>3</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</encryption_key>
<payment_action translate="label">
<label>Payment Action</label>
<frontend_type>select</frontend_type>
<source_model>paygate/authorizenet_source_paymentAction</source_model>
<sort_order>4</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</payment_action>
<order_status translate="label">
<label>New order status</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
<sort_order>5</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</order_status>
<test translate="label">
<label>Test mode</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>6</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</test>
<title translate="label">
<label>Title</label>
<frontend_type>text</frontend_type>
<sort_order>7</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</title>
</fields>
</CatalystCode_EwirePayment>
</groups>
</payment>
</sections>
</config>
Payment.php
<?php
class CatalystCode_EwirePayment_Model_Payment extends Mage_Payment_Model_Method_Abstract
{
protected $_code = 'ewirepayment';
protected $_isInitializeNeeded = true;
protected $_canUseInternal = false;
protected $_canUseForMultishipping = false;
/**
* Return Order place redirect url
*
* @return string
*/
public function getOrderPlaceRedirectUrl()
{
// TODO - fix the url when I'm able to select my payment method...
return Mage::getUrl('customcard/standard/redirect', array('_secure' => true));
}
}
Seems like you are missing a models section so it has no idea where to find your classes.
<?xml version="1.0"?>
<config>
<modules>
<CatalystCode_EwirePayment>
<version>0.1.0</version>
</CatalystCode_EwirePayment>
</modules>
<global>
<models>
<ewirepayment>
<class>CatalystCode_EwirePayment_Model</class>
</ewirepayment>
</models>
<resources>
<ewirepayment_setup>
<setup>
<module>CatalystCode_EwirePayment</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</ewirepayment_setup>
<ewirepayment_write>
<connection>
<use>core_write</use>
</connection>
</ewirepayment_write>
<ewirepayment_read>
<connection>
<use>core_read</use>
</connection>
</ewirepayment_read>
</resources>
<events>
<controller_front_init_routers>
<observers>
<CatalystCode_ewirepayment_model_observer>
<type>singleton</type>
<class>ewirepayment/observer</class>
<method>checkForConfigRequest</method>
</CatalystCode_ewirepayment_model_observer>
</observers>
</controller_front_init_routers>
</events>
<frontend>
<routers>
<ewirepayment>
<use>standard</use>
<args>
<module>CatalystCode_EwirePayment</module>
<frontName>ewirepayment</frontName>
</args>
</ewirepayment>
</routers>
</frontend>
</global>
<default>
<payment>
<ewirepayment>
<active>1</active>
<model>ewirepayment/payment</model>
<order_status>pending</order_status>
<title>Pay with Ewire</title>
</ewirepayment>
</payment>
</default>
</config>
精彩评论