magento自定义支付模块没有显示在现场网站.但显示在开发现场


magento custom payment module not showing in live site. but showing in development site

我正在经历一件非常奇怪的事情。我在我的开发服务器(Mac Lion)上制作了一个自定义支付模块。在开发服务器上,一切都很好,实际上都很完美。当我把它移到实时站点时,它在后台/admin和前端都不可见。

我花了好几个小时在这上面,却弄不明白。我可以提前看到模块标签并启用。我已经清除了缓存,实际上我也禁用了它。我不知道这里出了什么问题。我的开发和现场网站有相同的magento版本1.5.1。我在这里包括我的代码,所以欢迎提出问题所在。

config.xml

  <global>
    <models>
      <callpayment>
         <class>Bestdirect_CallPayment_Model</class>
      </callpayment>
    </models>
  </global>
 <default>
   <payment>
     <callpayment>
       <active>1</active>
       <model>callpayment/paymentMethod</model>
       <order_status>1</order_status>
       <title>ePayment</title>
       <payment_action>authorize_capture</payment_action>
    </callpayment>
  </payment>
 </default>
 <frontend>
   <routers>
    <callpayment>
        <use>standard</use>
        <args>
        <module>Bestdirect_CallPayment</module>
        <frontName>callpayment</frontName>
        </args>
    </callpayment>
  </routers>
 </frontend>

system.xml

<?xml version="1.0"?>
<config>
  <sections>
    <payment>
      <groups>
       <callpayment translate="label" module="paygate">
          <label>ePayment</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>
              <order_status translate="label">
                <label>New order status</label>
                <frontend_type>select</frontend_type>
                <source_model>adminhtml/system_config_source_order_status</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>
              </order_status>
             <allowspecific translate="label">
                <label>Payment from applicable countries</label>
                <frontend_type>allowspecific</frontend_type>
                <sort_order>50</sort_order>
       <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
              </allowspecific>
              <specificcountry translate="label">
                <label>Payment from Specific countries</label>
                <frontend_type>multiselect</frontend_type>
                <sort_order>51</sort_order>
                <source_model>adminhtml/system_config_source_country</source_model>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
              </specificcountry>
              <title translate="label">
               <label>Title</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>
              </title>
           </fields>
        </callpayment>
      </groups>
     </payment>
   </sections>
  </config>

PaymentMethod.php

  <?php
  require_once 'Bestdirect' . DS . 'Verkkomaksut_Module_Rest.php';
  class Bestdirect_CallPayment_Model_PaymentMethod extends Mage_Payment_Model_Method_Abstract
  {
    protected $_code  = 'callpayment';
    protected $_isInitializeNeeded      = true;
    protected $_canUseInternal          = false;
    protected $_canUseForMultishipping  = false;
public function capture(Varien_Object $payment, $amount) 
{
    $payment->getOrder()->setCanSendNewEmailFlag(false);
    return parent::capture($payment, $amount);
}
public function getOrderPlaceRedirectUrl()
{
    return Mage::getUrl('callpayment/standard/start', array('_secure' => true));
}

}

我的第一个问题是确定您的生产PHP include_path设置是否知道在哪里查找Bestdirect库。require_once语句将使用该路径,如果找不到库,则会失败。由于您可能禁用了display_errors,因此此故障在生产服务器上可能是静默的。

我知道这是一个老问题,但这可能会对某些人有所帮助。这可能是大写/小写的拼写错误。Zero Cool的模块名称是Bestdirect_CallPayment,如果在app/etc/Bestdirect_CallPayment.xml上,模块名称是用不同的大小写组合键入的(例如Bestdirect_Callpayment),它将在Mac上工作,但在Linux上不工作。这是因为文件系统处理大小写的方式。希望它能有所帮助!