1

I am using Magento 1.7.0.2.I have created a custom Payment Model.All are working fine but the values entered for the fields in checkout page are not displaying in Info Blocks.I have attached my block and view files.Please check and suggest whether am i doing anything wrong.

My view file(pay.phtml)

<?php $_code = $this->getMethodCode() ?>
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
    <li>
        <label for="<?php echo $_code ?>_bank_name" class="required"><em>*</em><?php echo $this->__('Bank Name#') ?></label>
        <span class="input-box">
            <input type="text" title="<?php echo $this->__('bank_name#') ?>" class="input-text required-entry" id="<?php echo $_code ?>_bank_name" name="payment[bank_name]" value="<?php echo $this->htmlEscape($this->getInfoData('bank_name')) ?>" />
        </span>
    </li>
    <li>
        <label for="<?php echo $_code ?>_routing_number" class="required"><em>*</em><?php echo $this->__('Routing Number#') ?></label>
        <span class="input-box">
            <input type="text" title="<?php echo $this->__('routing_number#') ?>" class="input-text required-entry validate-digits" id="<?php echo $_code ?>_routing_number" name="payment[routing_number]" value="<?php echo $this->htmlEscape($this->getInfoData('routing_number')) ?>" />
        </span>
    </li>
    <li>
        <label for="<?php echo $_code ?>_account_number" class="required"><em>*</em><?php echo $this->__('Account Number:') ?></label>
        <span class="input-box">
            <input type="text" title="<?php echo $this->__('Account Number') ?>" class="input-text required-entry validate-digits" id="<?php echo $_code ?>_account_number" name="payment[account_number]" value="<?php echo $this->htmlEscape($this->getInfoData('account_number')) ?>" />
        </span>
    </li>
    <li>
        <label for="<?php echo $_code ?>_name_on_account" class="required"><em>*</em><?php echo $this->__('Name On Account') ?></label>
        <span class="input-box">
            <input type="text" title="<?php echo $this->__('Name On Account') ?>" class="input-text required-entry" id="<?php echo $_code ?>_name_on_account" name="payment[name_on_account]" value="<?php echo $this->htmlEscape($this->getInfoData('name_on_account')) ?>" />
        </span>
    </li>
</ul>
<div>
    <?php echo $this->getMethod()->getConfigData('message'); ?>
</div>

Info Block file(Pay.php)

<?php

class Excellence_Pay_Block_Info_Pay extends Mage_Payment_Block_Info
{

    protected function _prepareSpecificInformation($transport = null)
    {
        if (null !== $this->_paymentSpecificInformation)
        {
            return $this->_paymentSpecificInformation;
        }
        $info = $this->getInfo();
        $transport = new Varien_Object();
        $transport = parent::_prepareSpecificInformation($transport);
        $transport->setData(array(
            Mage::helper('payment')->__('Bank Name') => $info->getPayBankName(),
            Mage::helper('payment')->__('Routing Number') => $info->getRoutingNumber()
        ));
        return $transport;
    }

}

Thanks in Advance!

1

I think everything happens here:

// \Mage_Checkout_Block_Onepage_Payment_Info::getPaymentInfo
public function getPaymentInfo()
{
    $info = Mage::getSingleton('checkout/session')->getQuote()->getPayment();
    if ($info->getMethod()) {
        return $info;
    }
    return false;
}

so the question is, what returns your implementation of Mage_Payment_Model_Method_Abstract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy