自定义付款方式 Magento - $_formBlockType

Custom payment method Magento - $_formBlockType

我在使用 Magento 中的自定义付款表单时遇到了一些困难。 我不断收到此错误:

invalid blocktype 

这是我目前所拥有的。

MobilePay
---------->Block
----------------->Form
----------------------->Default.php
---------->etc
----------------->config.xml
----------------->system.xml
---------->Model
----------------->Mobilepay.php

Default.php

<?php

class DevilfishMedia_MobilePay_Block_Form_Default extends Mage_Payment_Block_Form
{
    protected $_instructions;
    protected function _construct()
    {
        parent::_construct();
        $this->setTemplate('payment/form/mobilepay.phtml');
    }
    public function getInstructions()
    {
        if (is_null($this->_instructions)) {
            $this->_instructions = $this->getMethod()->getInstructions();
    }
        return $this->_instructions;
    }
}

config.xml

<?xml version="1.0"?>
<config>
<default>
        <payment>
            <mobilepay>
                <active>1</active>
                <model>mobilepay/mobilepay</model>
                <order_status>processing</order_status>
                <title>MobilePay</title>
            </mobilepay>
         </payment>
    </default>
  <modules>
    <DevilfishMedia_MobilePay>
      <version>0.1.0</version>
    </DevilfishMedia_MobilePay>
  </modules>
  <global>
    <helpers>
      <mobilepay>
        <class>DevilfishMedia_MobilePay_Helper</class>
      </mobilepay>
    </helpers>
    <models>
      <mobilepay>
        <class>DevilfishMedia_MobilePay_Model</class>
        <resourceModel>mobilepay_mysql4</resourceModel>
      </mobilepay>
            <payment>
                <rewrite>
                    <method_abstract>DevilfishMedia_MobilePay_Model_Payment_Method_Abstract</method_abstract>
                </rewrite>
            </payment>
    </models>
  </global>
</config>

system.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
   <sections>
        <payment>
            <groups>
                <mobilepay translate="label" module="mobilepay">
                    <label>MobilePay</label>
                    <sort_order>100</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>Ny ordre status</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_order_status_processing</source_model>
                            <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>


          </order_status>
                    <title translate="label">
                        <label>Titel</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>
                    </title>
                    <instructions translate="label">
                        <label>Beskrivelse</label>
                        <frontend_type>textarea</frontend_type>
                        <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>
                    </instructions>
                </fields>
            </mobilepay>
        </groups>
    </payment>
</sections>

Mobilepay.php

<?php 
class DevilfishMedia_Mobilepay_Model_Mobilepay extends Mage_Payment_Model_Method_Abstract
{   
    protected $_code = 'mobilepay';
    protected $_formBlockType = 'form_default';
    protected $_canUseInternal              = true; 
    protected $_canUseCheckout              = true;  
    protected $_canUseForMultishipping      = true;

    public function getInstructions()
    {
        return trim($this->getConfigData('instructions'));
    }
}

我认为我的问题出在模型和块类型的路径上,但我认为我花了太多时间调试问题,并且看不清楚了。

有人能看出错误在哪里吗?

声明模块的块:

  <global>
    <blocks>
      <mobilepay>
        <class>DevilfishMedia_MobilePay_Block</class>
      </mobilepay>
    </blocks>
    <helpers>
      <mobilepay>
        <class>DevilfishMedia_MobilePay_Helper</class>
      </mobilepay>
    </helpers>
    <models>
      <mobilepay>
        <class>DevilfishMedia_MobilePay_Model</class>
        <resourceModel>mobilepay_mysql4</resourceModel>
      </mobilepay>
            <payment>
                <rewrite>
                    <method_abstract>DevilfishMedia_MobilePay_Model_Payment_Method_Abstract</method_abstract>
                </rewrite>
            </payment>
    </models>
  </global>