title: Magento module Fatal error: Class 'Mage_Cashondelivery_Helper_Data' not found in \xampp\htdocs\magento\app\Mage.php on line 516
body: <p>I am developing a payment Module for Magento. I did this using this tutorial</p>
  
  <p><a href="http://www.magentocommerce.com/wiki/5_-_modules_and_development/payment/create-payment-method-module" rel="noreferrer">http://www.magentocommerce.com/wiki/5_-_modules_and_development/payment/create-payment-method-module</a></p>
  
  <p>I have created folder </p>
  
  <pre><code>app/local/Companyname/Cashondelivery/Block
  app/local/Companyname/Cashondelivery/Model
  app/local/Companyname/Cashondelivery/controller
  app/local/Companyname/Cashondelivery/etc
  app/local/Companyname/Cashondelivery/helpers
  </code></pre>
  
  <p>The etc/config.xml</p>
  
  <pre><code>    &lt;?xml version="1.0"?&gt;
      &lt;config&gt;
          &lt;modules&gt;
             &lt;Companyname_Cashondelivery&gt;
      &lt;!-- declare module's version information for database updates --&gt;
                &lt;version&gt;0.1.0&lt;/version&gt;
             &lt;/Companyname_Cashondelivery&gt;
          &lt;/modules&gt;
  
          &lt;global&gt;
  
  
      &lt;!-- declare model group for new module --&gt;
              &lt;models&gt;
      &lt;!-- model group alias to be used in Mage::getModel('newmodule/...') --&gt;
                  &lt;createorder&gt;
      &lt;!-- base class name for the model group --&gt;
                      &lt;class&gt;Companyname_Cashondelivery_createorder&lt;/class&gt;
                  &lt;/createorder&gt;
              &lt;/models&gt;
  
      &lt;!-- declare resource setup for new module --&gt;
              &lt;resources&gt;
      &lt;!-- resource identifier --&gt;
                  &lt;cashondelivery_setup&gt;
      &lt;!-- specify that this resource is a setup resource and used for upgrades --&gt;
                      &lt;setup&gt;
      &lt;!-- which module to look for install/upgrade files in --&gt;
                          &lt;module&gt;Companyname_Cashondelivery&lt;/module&gt;
                      &lt;/setup&gt;
      &lt;!-- specify database connection for this resource --&gt;
                      &lt;connection&gt;
      &lt;!-- do not create new connection, use predefined core setup connection --&gt;
                          &lt;use&gt;core_setup&lt;/use&gt;
                      &lt;/connection&gt;
                  &lt;/cashondelivery_setup&gt;
                  &lt;cashondelivery_write&gt;
                      &lt;connection&gt;
                        &lt;use&gt;core_write&lt;/use&gt;
                      &lt;/connection&gt;
                  &lt;/cashondelivery_write&gt;
                  &lt;cashondelivery_read&gt;
                     &lt;connection&gt;
                      &lt;use&gt;core_read&lt;/use&gt;
                    &lt;/connection&gt;
                  &lt;/cashondelivery_read&gt;
              &lt;/resources&gt;
          &lt;/global&gt;
  
      &lt;!-- declare default configuration values for this module --&gt;
          &lt;default&gt;
      &lt;!-- 'payment' configuration section (tab) --&gt;
              &lt;payment&gt;
      &lt;!-- 'newmodule' configuration group (fieldset) --&gt;
                  &lt;cashondelivery&gt;
      &lt;!-- by default this payment method is inactive --&gt;
                      &lt;active&gt;0&lt;/active&gt;
      &lt;!-- model to handle logic for this payment method --&gt;
                      &lt;model&gt;cashondelivery/createorder&lt;/model&gt;
      &lt;!-- order status for new orders paid by this payment method --&gt;
                      &lt;order_status&gt;pending&lt;/order_status&gt;
      &lt;!-- default title for payment checkout page and order view page --&gt;
                      &lt;title&gt;Companyname&lt;/title&gt;                
                  &lt;/cashondelivery&gt;
               &lt;/payment&gt;
          &lt;/default&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>The app/local/Companyname/Modulename/etc/system.xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
     &lt;sections&gt;
          &lt;payment&gt;
              &lt;groups&gt;
                  &lt;cashondelivery translate="label" module="cashondelivery"&gt;
                      &lt;label&gt;Cash On Delivery&lt;/label&gt;
                      &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                      &lt;sort_order&gt;10&lt;/sort_order&gt;
                      &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                      &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                      &lt;show_in_store&gt;1&lt;/show_in_store&gt;
                      &lt;!--&lt;comment&gt;[CDATA[&lt;a href="http://celinks.magento.com/authorize_netRegistration" target="_blank"&gt;Click here to sign up for an Authorize.net account&lt;/a&gt;]]&gt;&lt;/comment&gt;--&gt;
                      &lt;fields&gt;
                          &lt;active translate="label"&gt;
                              &lt;label&gt;Enabled&lt;/label&gt;
                              &lt;frontend_type&gt;select&lt;/frontend_type&gt;
                              &lt;source_model&gt;adminhtml/system_config_source_yesno&lt;/source_model&gt;
                              &lt;sort_order&gt;1&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/active&gt;
                          &lt;email_customer translate="label"&gt;
                              &lt;label&gt;Email Customer&lt;/label&gt;
                              &lt;frontend_type&gt;select&lt;/frontend_type&gt;
                              &lt;source_model&gt;adminhtml/system_config_source_yesno&lt;/source_model&gt;
                              &lt;sort_order&gt;10&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/email_customer&gt;
                          &lt;login translate="label"&gt;
                              &lt;label&gt;API Login ID&lt;/label&gt;
                              &lt;frontend_type&gt;obscure&lt;/frontend_type&gt;
                              &lt;backend_model&gt;adminhtml/system_config_backend_encrypted&lt;/backend_model&gt;
                              &lt;sort_order&gt;2&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/login&gt;
  
                          &lt;merchant_email translate="label"&gt;
                              &lt;label&gt;Merchant's Email&lt;/label&gt;
                              &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                              &lt;sort_order&gt;11&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/merchant_email&gt;
                          &lt;order_status translate="label"&gt;
                              &lt;label&gt;New Order Status&lt;/label&gt;
                              &lt;frontend_type&gt;select&lt;/frontend_type&gt;
                              &lt;source_model&gt;adminhtml/system_config_source_order_status_processing&lt;/source_model&gt;
                              &lt;sort_order&gt;4&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/order_status&gt;
                          &lt;sort_order translate="label"&gt;
                              &lt;label&gt;Sort Order&lt;/label&gt;
                              &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                              &lt;sort_order&gt;100&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/sort_order&gt;
                          &lt;test translate="label"&gt;
                              &lt;label&gt;Test Mode&lt;/label&gt;
                              &lt;frontend_type&gt;select&lt;/frontend_type&gt;
                              &lt;source_model&gt;adminhtml/system_config_source_yesno&lt;/source_model&gt;
                              &lt;sort_order&gt;5&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/test&gt;
                          &lt;debug translate="label"&gt;
                              &lt;label&gt;Debug&lt;/label&gt;
                              &lt;frontend_type&gt;select&lt;/frontend_type&gt;
                              &lt;source_model&gt;adminhtml/system_config_source_yesno&lt;/source_model&gt;
                              &lt;sort_order&gt;6&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/debug&gt;
                          &lt;title translate="label"&gt;
                              &lt;label&gt;Title&lt;/label&gt;
                              &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                              &lt;sort_order&gt;2&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;1&lt;/show_in_store&gt;
                          &lt;/title&gt;
  
                          &lt;payment_action translate="label"&gt;
                              &lt;label&gt;Payment Action&lt;/label&gt;
                              &lt;frontend_type&gt;select&lt;/frontend_type&gt;
                              &lt;source_model&gt;cashondelivery/createorder&lt;/source_model&gt;
                              &lt;sort_order&gt;2&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/payment_action&gt;
                          &lt;cgi_url&gt;
                              &lt;label&gt;Gateway URL&lt;/label&gt;
                              &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                              &lt;sort_order&gt;5&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/cgi_url&gt;                        
                          &lt;min_order_total translate="label"&gt;
                              &lt;label&gt;Minimum Order Total&lt;/label&gt;
                              &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                              &lt;sort_order&gt;98&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/min_order_total&gt;
                          &lt;max_order_total translate="label"&gt;
                              &lt;label&gt;Maximum Order Total&lt;/label&gt;
                              &lt;frontend_type&gt;text&lt;/frontend_type&gt;
                              &lt;sort_order&gt;99&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/max_order_total&gt;
                          &lt;allow_partial_authorization translate="label"&gt;
                              &lt;label&gt;Allow Partial Authorization&lt;/label&gt;
                              &lt;frontend_type&gt;select&lt;/frontend_type&gt;
                              &lt;source_model&gt;adminhtml/system_config_source_yesno&lt;/source_model&gt;
                              &lt;sort_order&gt;110&lt;/sort_order&gt;
                              &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                              &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                              &lt;show_in_store&gt;0&lt;/show_in_store&gt;
                          &lt;/allow_partial_authorization&gt;                     
                          &lt;model&gt;
                          &lt;/model&gt;
                      &lt;/fields&gt;
                  &lt;/cashondelivery&gt;
              &lt;/groups&gt;
          &lt;/payment&gt;
      &lt;/sections&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>Then I created a model class</p>
  
  <pre><code>&lt;?php 
  /**
  * Our test CC module adapter
  */
  class Companyname_Cashondelivery_Model_createorder extends Mage_Payment_Model_Method_Cc
  {
      /**
      * unique internal payment method identifier
      *
      * @var string [a-z0-9_]
      */
      protected $_code = 'newmodule';
  
      /**
       * Here are examples of flags that will determine functionality availability
       * of this module to be used by frontend and backend.
       *
       * @see all flags and their defaults in Mage_Payment_Model_Method_Abstract
       *
       * It is possible to have a custom dynamic logic by overloading
       * public function can* for each flag respectively
       */
  
      /**
       * Is this payment method a gateway (online auth/charge) ?
       */
      protected $_isGateway               = true;
  
      /**
       * Can authorize online?
       */
      protected $_canAuthorize            = true;
  
      /**
       * Can capture funds online?
       */
      protected $_canCapture              = false;
  
      /**
       * Can capture partial amounts online?
       */
      protected $_canCapturePartial       = false;
  
      /**
       * Can refund online?
       */
      protected $_canRefund               = false;
  
      /**
       * Can void transactions online?
       */
      protected $_canVoid                 = true;
  
      /**
       * Can use this payment method in administration panel?
       */
      protected $_canUseInternal          = true;
  
      /**
       * Can show this payment method as an option on checkout payment page?
       */
      protected $_canUseCheckout          = true;
  
      /**
       * Is this payment method suitable for multi-shipping checkout?
       */
      protected $_canUseForMultishipping  = true;
  
      /**
       * Can save credit card information for future processing?
       */
      protected $_canSaveCc = false;
  
      /**
       * Here you will need to implement authorize, capture and void public methods
       *
       * @see examples of transaction specific public methods such as
       * authorize, capture and void in Mage_Paygate_Model_Authorizenet
       */        
  }
  ?&gt;
  </code></pre>
  
  <p>I have even created a file in app/local/Companyname/Cashondelivery/Helper/Data.php</p>
  
  <pre><code>&lt;?php
  class Companyname_Cashondelivery_Helper_Data extends Mage_Core_Helper_Abstract
  {
  }
  ?&gt;
  </code></pre>
  
  <p>But I get an error when I open Configuration>Payment Methods</p>
  
  <p>Fatal error: Class 'Mage_Cashondelivery_Helper_Data' not found in C:\xampp\htdocs\magento\app\Mage.php on line 516</p>
  
  <p>Is it necessary to have a Helper class. I have no idea about the helpers and Data.php</p>