magento自定义支付模块未在实时网站中显示。但在开发网站上显示

时间:2012-04-04 14:01:47

标签: php xml magento-1.5 magento

我遇到了很奇怪的事情。我在我的开发服务器(Mac Lion)上制作了自定义支付模块。在开发服务器上,一切都很棒。当我将它移动到实时站点时,它在后端/管理员和前端都不可见。

我花了好几个小时但却无法理解。我可以在预先看到模块并启用它。我已经清除了缓存,实际上我也禁用了它。我不确定这里有什么不对。我的开发和实时网站具有相同的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));
}

}

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:-1)

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

相关问题