Example #1
0
 /**
  * Get form instance
  * 
  * @return Mage_Authorizenet_Block_Directpost_Form
  */
 public function getForm()
 {
     if (!$this->_formBlock) {
         $this->_formBlock = Mage::getSingleton('core/layout')->createBlock($this->getMethod()->getFormBlockType());
         $this->_formBlock->setMethod($this->getMethod());
     }
     return $this->_formBlock;
 }
Example #2
0
 protected function _toHtml()
 {
     try {
         $this->getMethod();
     } catch (Exception $e) {
         return null;
     }
     if (!Mage::getStoreConfig('payment/authorizenet_directpost/active')) {
         return null;
     }
     if ($this->getMethod()->getCode() != Mage::getSingleton('authorizenet/directpost')->getCode()) {
         return null;
     }
     $html = parent::_toHtml();
     //start of fix for #0028299 bug
     $html = str_ireplace('<form id="co-directpost-form" action="#" method="post">', '<!--<form id="co-directpost-form" action="#" method="post">-->', $html);
     $html = str_ireplace('</form>', '<!--</form>-->', $html);
     //end of fix for #0028299 bug
     return $html;
 }