0

I am experiencing very strange thing. I have made a custom payment module on my development server (Mac Lion). Everything works great actually perfect on dev server. When i move it to live site it is not visible in backend/admin as well as in the front.

I have spent hours on it but cannot figure it out. I can see the module in advance tab and enabled. I have cleared cache actually i have disabled it as well. I am not sure what wrong here. My development and live site has same magento version 1.5.1. I am including my code here so please welcome to suggest what the problem is.

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));
}

}

Zero Cool
  • 459
  • 1
  • 9
  • 23

2 Answers2

0

At a glance my first question would be to determine whether your production PHP include_path setting knows where to look for the Bestdirect library. The require_once statement will use that path, and fail if it can't find the library. This failure will presumably be silent on your production server since you probably have display_errors disabled.

Jason Gilmore
  • 3,698
  • 3
  • 23
  • 28
  • I actually tried by removing require_once and removed anything. I only left model calss name and protected $_code but same thing. – Zero Cool Apr 04 '12 at 14:29
  • Can you clarify? Removing `require_once` will probably make the problem worse because `Verkkomaksut_Module_Rest.php` won't load. Either prepend the complete path to the `Bestdirect` library or modify your PHP `include_path` setting to point to that path. I suspect this is contributing to the problem you are facing. – Jason Gilmore Apr 04 '12 at 14:55
  • Maybe i should clarify. i removed require once and anything function requiring Verkkomaksut_Module_Rest.php. Actually i just created a simple payment module with just model class. It works on dev site bit not on live site. – Zero Cool Apr 04 '12 at 15:01
-1

I know this is a old question, but this could help somebody. This is probably a typo on on upper/lowercase. Zero Cool's module name is Bestdirect_CallPayment, if on app/etc/Bestdirect_CallPayment.xml the module name is typed on a different upper/lowercase combination (e.g Bestdirect_Callpayment) it will work on a Mac but not on Linux. That's because the way file systems deal with upper/lowercase. Hope it helps!

ByteNudger
  • 1,545
  • 5
  • 29
  • 37