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:  * PayPal module observer
 29:  *
 30:  * @author      Magento Core Team <core@magentocommerce.com>
 31:  */
 32: 
 33: class Mage_Paypal_Model_Observer
 34: {
 35:     /**
 36:      * Goes to reports.paypal.com and fetches Settlement reports.
 37:      * @return Mage_Paypal_Model_Observer
 38:      */
 39:     public function fetchReports()
 40:     {
 41:         try {
 42:             $reports = Mage::getModel('paypal/report_settlement');
 43:             /* @var $reports Mage_Paypal_Model_Report_Settlement */
 44:             $credentials = $reports->getSftpCredentials(true);
 45:             foreach ($credentials as $config) {
 46:                 try {
 47:                     $reports->fetchAndSave($config);
 48:                 } catch (Exception $e) {
 49:                     Mage::logException($e);
 50:                 }
 51:             }
 52:         } catch (Exception $e) {
 53:             Mage::logException($e);
 54:         }
 55:     }
 56: 
 57:     /**
 58:      * Clean unfinished transaction
 59:      *
 60:      * @deprecated since 1.6.2.0
 61:      * @return Mage_Paypal_Model_Observer
 62:      */
 63:     public function cleanTransactions()
 64:     {
 65:         return $this;
 66:     }
 67: 
 68:     /**
 69:      * Save order into registry to use it in the overloaded controller.
 70:      *
 71:      * @param Varien_Event_Observer $observer
 72:      * @return Mage_Paypal_Model_Observer
 73:      */
 74:     public function saveOrderAfterSubmit(Varien_Event_Observer $observer)
 75:     {
 76:         /* @var $order Mage_Sales_Model_Order */
 77:         $order = $observer->getEvent()->getData('order');
 78:         Mage::register('hss_order', $order, true);
 79: 
 80:         return $this;
 81:     }
 82: 
 83:     /**
 84:      * Set data for response of frontend saveOrder action
 85:      *
 86:      * @param Varien_Event_Observer $observer
 87:      * @return Mage_Paypal_Model_Observer
 88:      */
 89:     public function setResponseAfterSaveOrder(Varien_Event_Observer $observer)
 90:     {
 91:         /* @var $order Mage_Sales_Model_Order */
 92:         $order = Mage::registry('hss_order');
 93: 
 94:         if ($order && $order->getId()) {
 95:             $payment = $order->getPayment();
 96:             if ($payment && in_array($payment->getMethod(), Mage::helper('paypal/hss')->getHssMethods())) {
 97:                 /* @var $controller Mage_Core_Controller_Varien_Action */
 98:                 $controller = $observer->getEvent()->getData('controller_action');
 99:                 $result = Mage::helper('core')->jsonDecode(
100:                     $controller->getResponse()->getBody('default'),
101:                     Zend_Json::TYPE_ARRAY
102:                 );
103: 
104:                 if (empty($result['error'])) {
105:                     $controller->loadLayout('checkout_onepage_review');
106:                     $html = $controller->getLayout()->getBlock('paypal.iframe')->toHtml();
107:                     $result['update_section'] = array(
108:                         'name' => 'paypaliframe',
109:                         'html' => $html
110:                     );
111:                     $result['redirect'] = false;
112:                     $result['success'] = false;
113:                     $controller->getResponse()->clearHeader('Location');
114:                     $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
115:                 }
116:             }
117:         }
118: 
119:         return $this;
120:     }
121: 
122:     /**
123:      * Load country dependent PayPal solutions system configuration
124:      *
125:      * @param Varien_Event_Observer $observer
126:      * @return void
127:      */
128:     public function loadCountryDependentSolutionsConfig(Varien_Event_Observer $observer)
129:     {
130:         $requestParam = Mage_Paypal_Block_Adminhtml_System_Config_Field_Country::REQUEST_PARAM_COUNTRY;
131:         $countryCode  = Mage::app()->getRequest()->getParam($requestParam);
132:         if (is_null($countryCode) || preg_match('/^[a-zA-Z]{2}$/', $countryCode) == 0) {
133:             $countryCode = (string)Mage::getSingleton('adminhtml/config_data')
134:                 ->getConfigDataValue('paypal/general/merchant_country');
135:         }
136:         if (empty($countryCode)) {
137:             $countryCode = Mage::helper('core')->getDefaultCountry();
138:         }
139: 
140:         $paymentGroups   = $observer->getEvent()->getConfig()->getNode('sections/payment/groups');
141:         $paymentsConfigs = $paymentGroups->xpath('paypal_payments/*/backend_config/' . $countryCode);
142:         if ($paymentsConfigs) {
143:             foreach ($paymentsConfigs as $config) {
144:                 $parent = $config->getParent()->getParent();
145:                 $parent->extend($config, true);
146:             }
147:         }
148: 
149:         $payments = $paymentGroups->xpath('paypal_payments/*');
150:         foreach ($payments as $payment) {
151:             if ((int)$payment->include) {
152:                 $fields = $paymentGroups->xpath((string)$payment->group . '/fields');
153:                 if (isset($fields[0])) {
154:                     $fields[0]->appendChild($payment, true);
155:                 }
156:             }
157:         }
158:     }
159: }
160: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0