Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Paypal_Adminhtml_Paypal_ReportsController
  • Mage_Paypal_Block_Adminhtml_Settlement_Details
  • Mage_Paypal_Block_Adminhtml_Settlement_Details_Form
  • Mage_Paypal_Block_Adminhtml_Settlement_Report
  • Mage_Paypal_Block_Adminhtml_Settlement_Report_Grid
  • Mage_Paypal_Block_Adminhtml_System_Config_ApiWizard
  • Mage_Paypal_Block_Adminhtml_System_Config_Field_Country
  • Mage_Paypal_Block_Adminhtml_System_Config_Field_Hidden
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Expanded
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Group
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Hint
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Location
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Payment
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Store
  • Mage_Paypal_Block_Adminhtml_System_Config_Payflowlink_Advanced
  • Mage_Paypal_Block_Adminhtml_System_Config_Payflowlink_Info
  • Mage_Paypal_Block_Express_Form
  • Mage_Paypal_Block_Express_Review
  • Mage_Paypal_Block_Express_Review_Billing
  • Mage_Paypal_Block_Express_Review_Details
  • Mage_Paypal_Block_Express_Review_Shipping
  • Mage_Paypal_Block_Express_Shortcut
  • Mage_Paypal_Block_Hosted_Pro_Form
  • Mage_Paypal_Block_Hosted_Pro_Iframe
  • Mage_Paypal_Block_Hosted_Pro_Info
  • Mage_Paypal_Block_Iframe
  • Mage_Paypal_Block_Logo
  • Mage_Paypal_Block_Payflow_Advanced_Form
  • Mage_Paypal_Block_Payflow_Advanced_Iframe
  • Mage_Paypal_Block_Payflow_Advanced_Info
  • Mage_Paypal_Block_Payflow_Link_Form
  • Mage_Paypal_Block_Payflow_Link_Iframe
  • Mage_Paypal_Block_Payflow_Link_Info
  • Mage_Paypal_Block_Payment_Info
  • Mage_Paypal_Block_Standard_Form
  • Mage_Paypal_Block_Standard_Redirect
  • Mage_Paypal_Controller_Express_Abstract
  • Mage_Paypal_ExpressController
  • Mage_Paypal_Helper_Data
  • Mage_Paypal_Helper_Hss
  • Mage_Paypal_HostedproController
  • Mage_Paypal_IpnController
  • Mage_Paypal_Model_Api_Abstract
  • Mage_Paypal_Model_Api_Nvp
  • Mage_Paypal_Model_Api_Standard
  • Mage_Paypal_Model_Cart
  • Mage_Paypal_Model_Cert
  • Mage_Paypal_Model_Config
  • Mage_Paypal_Model_Direct
  • Mage_Paypal_Model_Express
  • Mage_Paypal_Model_Express_Checkout
  • Mage_Paypal_Model_Hostedpro
  • Mage_Paypal_Model_Hostedpro_Request
  • Mage_Paypal_Model_Info
  • Mage_Paypal_Model_Ipn
  • Mage_Paypal_Model_Method_Agreement
  • Mage_Paypal_Model_Mysql4_Cert
  • Mage_Paypal_Model_Mysql4_Report_Settlement
  • Mage_Paypal_Model_Mysql4_Report_Settlement_Row
  • Mage_Paypal_Model_Mysql4_Report_Settlement_Row_Collection
  • Mage_Paypal_Model_Mysql4_Setup
  • Mage_Paypal_Model_Observer
  • Mage_Paypal_Model_Payflow_Request
  • Mage_Paypal_Model_Payflowadvanced
  • Mage_Paypal_Model_Payflowlink
  • Mage_Paypal_Model_Payflowpro
  • Mage_Paypal_Model_Payment_Transaction
  • Mage_Paypal_Model_Pro
  • Mage_Paypal_Model_Report_Settlement
  • Mage_Paypal_Model_Report_Settlement_Row
  • Mage_Paypal_Model_Resource_Cert
  • Mage_Paypal_Model_Resource_Report_Settlement
  • Mage_Paypal_Model_Resource_Report_Settlement_Row
  • Mage_Paypal_Model_Resource_Report_Settlement_Row_Collection
  • Mage_Paypal_Model_Resource_Setup
  • Mage_Paypal_Model_Session
  • Mage_Paypal_Model_Standard
  • Mage_Paypal_Model_System_Config_Backend_Cert
  • Mage_Paypal_Model_System_Config_Backend_Cron
  • Mage_Paypal_Model_System_Config_Backend_MerchantCountry
  • Mage_Paypal_Model_System_Config_Source_BuyerCountry
  • Mage_Paypal_Model_System_Config_Source_FetchingSchedule
  • Mage_Paypal_Model_System_Config_Source_Logo
  • Mage_Paypal_Model_System_Config_Source_MerchantCountry
  • Mage_Paypal_Model_System_Config_Source_PaymentActions
  • Mage_Paypal_Model_System_Config_Source_PaymentActions_Express
  • Mage_Paypal_Model_System_Config_Source_RequireBillingAddress
  • Mage_Paypal_Model_System_Config_Source_UrlMethod
  • Mage_Paypal_PayflowadvancedController
  • Mage_Paypal_PayflowController
  • Mage_Paypal_StandardController

Exceptions

  • Mage_Paypal_Exception
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Paypal
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * HSS iframe block
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Paypal
 32:  * @author     Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Paypal_Block_Iframe extends Mage_Payment_Block_Form
 35: {
 36:     /**
 37:      * Whether the block should be eventually rendered
 38:      *
 39:      * @var bool
 40:      */
 41:     protected $_shouldRender = false;
 42: 
 43:     /**
 44:      * Order object
 45:      *
 46:      * @var Mage_Sales_Model_Order
 47:      */
 48:     protected $_order;
 49: 
 50:     /**
 51:      * Payment method code
 52:      *
 53:      * @var string
 54:      */
 55:     protected $_paymentMethodCode;
 56: 
 57:     /**
 58:      * Current iframe block instance
 59:      *
 60:      * @var Mage_Payment_Block_Form
 61:      */
 62:     protected $_block;
 63: 
 64:     /**
 65:      * Internal constructor
 66:      * Set info template for payment step
 67:      *
 68:      */
 69:     protected function _construct()
 70:     {
 71:         parent::_construct();
 72:         $paymentCode = $this->_getCheckout()
 73:             ->getQuote()
 74:             ->getPayment()
 75:             ->getMethod();
 76:         if (in_array($paymentCode, $this->helper('paypal/hss')->getHssMethods())) {
 77:             $this->_paymentMethodCode = $paymentCode;
 78:             $templatePath = str_replace('_', '', $paymentCode);
 79:             $templateFile = "paypal/{$templatePath}/iframe.phtml";
 80:             if (file_exists(Mage::getDesign()->getTemplateFilename($templateFile))) {
 81:                 $this->setTemplate($templateFile);
 82:             } else {
 83:                 $this->setTemplate('paypal/hss/iframe.phtml');
 84:             }
 85:         }
 86:     }
 87: 
 88:     /**
 89:      * Get current block instance
 90:      *
 91:      * @return Mage_Paypal_Block_Iframe
 92:      */
 93:     protected function _getBlock()
 94:     {
 95:         if (!$this->_block) {
 96:             $this->_block = $this->getAction()
 97:                 ->getLayout()
 98:                 ->createBlock('paypal/'.$this->_paymentMethodCode.'_iframe');
 99:             if (!$this->_block instanceof Mage_Paypal_Block_Iframe) {
100:                 Mage::throwException('Invalid block type');
101:             }
102:         }
103: 
104:         return $this->_block;
105:     }
106: 
107:     /**
108:      * Get order object
109:      *
110:      * @return Mage_Sales_Model_Order
111:      */
112:     protected function _getOrder()
113:     {
114:         if (!$this->_order) {
115:             $incrementId = $this->_getCheckout()->getLastRealOrderId();
116:             $this->_order = Mage::getModel('sales/order')
117:                 ->loadByIncrementId($incrementId);
118:         }
119:         return $this->_order;
120:     }
121: 
122:     /**
123:      * Get frontend checkout session object
124:      *
125:      * @return Mage_Checkout_Model_Session
126:      */
127:     protected function _getCheckout()
128:     {
129:         return Mage::getSingleton('checkout/session');
130:     }
131: 
132:     /**
133:      * Before rendering html, check if is block rendering needed
134:      *
135:      * @return Mage_Core_Block_Abstract
136:      */
137:     protected function _beforeToHtml()
138:     {
139:         if ($this->_getOrder()->getId() &&
140:             $this->_getOrder()->getQuoteId() == $this->_getCheckout()->getLastQuoteId() &&
141:             $this->_paymentMethodCode) {
142:             $this->_shouldRender = true;
143:         }
144: 
145:         if ($this->getGotoSection() || $this->getGotoSuccessPage()) {
146:             $this->_shouldRender = true;
147:         }
148: 
149:         return parent::_beforeToHtml();
150:     }
151: 
152:     /**
153:      * Render the block if needed
154:      *
155:      * @return string
156:      */
157:     protected function _toHtml()
158:     {
159:         if ($this->_isAfterPaymentSave()) {
160:             $this->setTemplate('paypal/hss/js.phtml');
161:             return parent::_toHtml();
162:         }
163:         if (!$this->_shouldRender) {
164:             return '';
165:         }
166:         return parent::_toHtml();
167:     }
168: 
169:     /**
170:      * Check whether block is rendering after save payment
171:      *
172:      * @return bool
173:      */
174:     protected function _isAfterPaymentSave()
175:     {
176:         $quote = $this->_getCheckout()->getQuote();
177:         if ($quote->getPayment()->getMethod() == $this->_paymentMethodCode &&
178:             $quote->getIsActive() &&
179:             $this->getTemplate() &&
180:             $this->getRequest()->getActionName() == 'savePayment') {
181:             return true;
182:         }
183: 
184:         return false;
185:     }
186: 
187:     /**
188:      * Get iframe action URL
189:      *
190:      * @return string
191:      */
192:     public function getFrameActionUrl()
193:     {
194:         return $this->_getBlock()->getFrameActionUrl();
195:     }
196: 
197:     /**
198:      * Get secure token
199:      *
200:      * @return string
201:      */
202:     public function getSecureToken()
203:     {
204:         return $this->_getBlock()->getSecureToken();
205:     }
206: 
207:     /**
208:      * Get secure token ID
209:      *
210:      * @return string
211:      */
212:     public function getSecureTokenId()
213:     {
214:         return $this->_getBlock()->getSecureTokenId();
215:     }
216: 
217:     /**
218:      * Get payflow transaction URL
219:      *
220:      * @return string
221:      */
222:     public function getTransactionUrl()
223:     {
224:         return $this->_getBlock()->getTransactionUrl();
225:     }
226: 
227:     /**
228:      * Check sandbox mode
229:      *
230:      * @return bool
231:      */
232:     public function isTestMode()
233:     {
234:         return $this->_getBlock()->isTestMode();
235:     }
236: }
237: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0