Magento 1.9.x付款扩展

时间:2018-08-31 08:12:05

标签: php magento model-view-controller payment-gateway magento-1.9

我是Magento 1.9.x的新手,我需要写付款扩展名 现在我有些麻烦 我需要将字段添加到我的数据表格中,该表格必须发送到付款网关, 但是当我在文件中写这个 \app\code\community\Ecc\Paygate\Model\Request.php

class Ecc_Paygate_Model_Request extends Varien_Object

{

    const FIELD_NAME_MERCHANT_ID = 'MerchantID';
    const FIELD_NAME_MERCHANT_SECRET_KEY = 'TerminalID';
    const FIELD_NAME_PAYMENT_TIME = '';
    const FIELD_NAME_PAYMENT_NO = 'OrderID';
    const FIELD_NAME_PAYMENT_CURRENCY = '980';
    const FIELD_NAME_PAYMENT_AMOUNT = 'TotalAmount';
    const FIELD_NAME_SESSION = 'aa';
    const FIELD_NAME_PAYMENT_DESC = 'PurchaseDesc';

我在此行上的app \ code \ community \ Ecc \ Paygate \ controllers \ PaymentController.php中出现错误

  

致命错误:在第28行的/app/code/community/Ecc/Paygate/controllers/PaymentController.php中的布尔值上调用成员函数toHtml()

$this->getResponse()->setBody($block->toHtml());

class Ecc_Paygate_PaymentController extends Mage_Core_Controller_Front_Action
{

    public function redirectAction()
    {
        $block = $this->getLayout()->createBlock('ecc_paygate/method_form', 'paygate_redirect',
            array('template' => 'paygate/redirect.phtml'));
        $this->getResponse()->setBody($block->toHtml());
    }

1 个答案:

答案 0 :(得分:0)

如果给定的块类不存在,方法createBlock返回false

public function createBlock($type, $name='', array $attributes = array())
{
    try {
        $block = $this->_getBlockInstance($type, $attributes);
    } catch (Exception $e) {
        Mage::logException($e);
        return false;
    }

因此“ ecc_paygate / method_form”似乎无效。

还没有可用的收费站额外信息? here