1
我在自定義付款模塊中遇到了一些問題。自定義付款模塊在結帳時未顯示在前端
問題是,無論我嘗試什麼,我都無法在前端看到我的付款方式的選擇。
這看起來像是類似問題的重複,但我已經閱讀過它們,並且解決方案對我而言並不適用。
的設置
文件樹:
/app/code/local/CatalystCode/EwirePayment/
-controllers/
--CallbackController.php
-etc/
--config.xml
-etc/
--system.xml
-Model/
--Payment.php
內容
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>
<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));
}
}
輝煌的,李 - 如果你只知道我一直在掙扎多少,這太可怕了。我找不到任何真實的文檔,調試方法或任何東西。在官方論壇上詢問文件是顯而易見的。謝謝,因爲發現了這個 - 最後我可以繼續使用我的模塊。 – Repox