00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 class Mage_Payment_Block_Info_Checkmo extends Mage_Payment_Block_Info
00029 {
00030
00031 protected $_payableTo;
00032 protected $_mailingAddress;
00033
00034 protected function _construct()
00035 {
00036 parent::_construct();
00037 $this->setTemplate('payment/info/checkmo.phtml');
00038 }
00039
00040
00041
00042
00043
00044
00045 public function getPayableTo()
00046 {
00047 if (is_null($this->_payableTo)) {
00048 $this->_convertAdditionalData();
00049 }
00050 return $this->_payableTo;
00051 }
00052
00053
00054
00055
00056
00057
00058 public function getMailingAddress()
00059 {
00060 if (is_null($this->_mailingAddress)) {
00061 $this->_convertAdditionalData();
00062 }
00063 return $this->_mailingAddress;
00064 }
00065
00066
00067
00068
00069
00070
00071 protected function _convertAdditionalData()
00072 {
00073 $details = @unserialize($this->getInfo()->getAdditionalData());
00074 if (is_array($details)) {
00075 $this->_payableTo = isset($details['payable_to']) ? (string) $details['payable_to'] : '';
00076 $this->_mailingAddress = isset($details['mailing_address']) ? (string) $details['mailing_address'] : '';
00077 } else {
00078 $this->_payableTo = '';
00079 $this->_mailingAddress = '';
00080 }
00081 return $this;
00082 }
00083
00084 public function toPdf()
00085 {
00086 $this->setTemplate('payment/info/pdf/checkmo.phtml');
00087 return $this->toHtml();
00088 }
00089
00090 }