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_Paypal_Block_Express_Info extends Mage_Payment_Block_Info
00029 {
00030 protected function _construct()
00031 {
00032 parent::_construct();
00033 $this->setTemplate('paypal/express/info.phtml');
00034 }
00035
00036 public function getEmail()
00037 {
00038 $p = $this->getInfo();
00039 if ($p->getAdditionalData()) {
00040 $email = $p->getAdditionalData();
00041 } elseif ($p instanceof Mage_Sales_Model_Quote_Payment) {
00042 $email = $p->getQuote()->getBillingAddress()->getEmail();
00043 } elseif ($p instanceof Mage_Sales_Model_Order_Payment) {
00044 if ($p->getOrder()->getBillingAddress()->getEmail()) {
00045 $email = $p->getOrder()->getBillingAddress()->getEmail();
00046 } else {
00047 $email = $p->getOrder()->getCustomerEmail();
00048 }
00049 } else {
00050 $email = Mage::helper('paypal')->__("N/A");
00051 }
00052 return $email;
00053 }
00054
00055 public function toPdf()
00056 {
00057 $this->setTemplate('paypal/express/pdf/info.phtml');
00058 return $this->toHtml();
00059 }
00060 }