I have created a payment method and it has a _prepareSpecificInformation()
that is extended under the Mage_Payment_Block_Info
. Just need to detect where this is being called from with in the function as there are some points that I want to show everything and others, like an email, that I don't. This is what I have now.
protected function _prepareSpecificInformation($transport = null){
$helper = Mage::helper('centralprocessing');
if ($this->_paymentSpecificInformation !== null) {
return $this->_paymentSpecificInformation;
}
$info = $this->getInfo();
$transport = new Varien_Object();
$transport = parent::_prepareSpecificInformation($transport);
$transData=array();
$transData[Mage::helper('payment')->__('Card Type')]=$helper->getCardType($info->getCardType());
$transData[Mage::helper('payment')->__('Masked CC Number')]='############'.$info->getMaskedCcNumber();
$transData[Mage::helper('payment')->__('Response Return Code')]="".$info->getResponseReturnCode();
$transData[Mage::helper('payment')->__('GUID')]=$info->getResponseGuid();
$transData[Mage::helper('payment')->__('Approval Code')]=$info->getApprovalCode();
$transport->addData($transData);
return $transport;
}
So I wanted to add conditions on what is added to the $transData
array depending if it's the admin or if it's in the email and such.
UPDATE The reason is that I need to put a link in with the data in the admin page only. Also turns out that
$transData[Mage::helper('payment')->__('GUID')]="<h1>HELLO</h1>";
Prints <h1>HELLO</h1>
so the html is escaped first?