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:  * Model for report rows
 29:  */
 30: /**
 31:  * Enter description here ...
 32:  *
 33:  * @method Mage_Paypal_Model_Resource_Report_Settlement_Row _getResource()
 34:  * @method Mage_Paypal_Model_Resource_Report_Settlement_Row getResource()
 35:  * @method int getReportId()
 36:  * @method Mage_Paypal_Model_Report_Settlement_Row setReportId(int $value)
 37:  * @method string getTransactionId()
 38:  * @method Mage_Paypal_Model_Report_Settlement_Row setTransactionId(string $value)
 39:  * @method string getInvoiceId()
 40:  * @method Mage_Paypal_Model_Report_Settlement_Row setInvoiceId(string $value)
 41:  * @method string getPaypalReferenceId()
 42:  * @method Mage_Paypal_Model_Report_Settlement_Row setPaypalReferenceId(string $value)
 43:  * @method string getPaypalReferenceIdType()
 44:  * @method Mage_Paypal_Model_Report_Settlement_Row setPaypalReferenceIdType(string $value)
 45:  * @method string getTransactionEventCode()
 46:  * @method Mage_Paypal_Model_Report_Settlement_Row setTransactionEventCode(string $value)
 47:  * @method string getTransactionInitiationDate()
 48:  * @method Mage_Paypal_Model_Report_Settlement_Row setTransactionInitiationDate(string $value)
 49:  * @method string getTransactionCompletionDate()
 50:  * @method Mage_Paypal_Model_Report_Settlement_Row setTransactionCompletionDate(string $value)
 51:  * @method string getTransactionDebitOrCredit()
 52:  * @method Mage_Paypal_Model_Report_Settlement_Row setTransactionDebitOrCredit(string $value)
 53:  * @method float getGrossTransactionAmount()
 54:  * @method Mage_Paypal_Model_Report_Settlement_Row setGrossTransactionAmount(float $value)
 55:  * @method string getGrossTransactionCurrency()
 56:  * @method Mage_Paypal_Model_Report_Settlement_Row setGrossTransactionCurrency(string $value)
 57:  * @method string getFeeDebitOrCredit()
 58:  * @method Mage_Paypal_Model_Report_Settlement_Row setFeeDebitOrCredit(string $value)
 59:  * @method float getFeeAmount()
 60:  * @method Mage_Paypal_Model_Report_Settlement_Row setFeeAmount(float $value)
 61:  * @method string getFeeCurrency()
 62:  * @method Mage_Paypal_Model_Report_Settlement_Row setFeeCurrency(string $value)
 63:  * @method string getCustomField()
 64:  * @method Mage_Paypal_Model_Report_Settlement_Row setCustomField(string $value)
 65:  * @method string getConsumerId()
 66:  * @method Mage_Paypal_Model_Report_Settlement_Row setConsumerId(string $value)
 67:  *
 68:  * @category    Mage
 69:  * @package     Mage_Paypal
 70:  * @author      Magento Core Team <core@magentocommerce.com>
 71:  */
 72: class Mage_Paypal_Model_Report_Settlement_Row extends Mage_Core_Model_Abstract
 73: {
 74:     /**
 75:      * Assoc array event code => label
 76:      *
 77:      * @var array
 78:      */
 79:     protected static $_eventList = array();
 80: 
 81:     /**
 82:      * Casted amount keys registry
 83:      *
 84:      * @var array
 85:      */
 86:     protected $_castedAmounts = array();
 87: 
 88:     /**
 89:      * Initialize resource model
 90:      */
 91:     protected function _construct()
 92:     {
 93:         $this->_init('paypal/report_settlement_row');
 94:     }
 95: 
 96:     /**
 97:      * Return description of Reference ID Type
 98:      * If no code specified, return full list of codes with their description
 99:      *
100:      * @param string code
101:      * @return string|array
102:      */
103:     public function getReferenceType($code = null)
104:     {
105:         $types = array(
106:             'TXN' => Mage::helper('paypal')->__('Transaction ID'),
107:             'ODR' => Mage::helper('paypal')->__('Order ID'),
108:             'SUB' => Mage::helper('paypal')->__('Subscription ID'),
109:             'PAP' => Mage::helper('paypal')->__('Preapproved Payment ID')
110:         );
111:         if($code === null) {
112:             asort($types);
113:             return $types;
114:         }
115:         if (isset($types[$code])) {
116:             return $types[$code];
117:         }
118:         return $code;
119:     }
120: 
121:     /**
122:      * Get native description for transaction code
123:      *
124:      * @param string code
125:      * @return string
126:      */
127:     public function getTransactionEvent($code)
128:     {
129:         $this->_generateEventLabels();
130:         if (isset(self::$_eventList[$code])) {
131:             return self::$_eventList[$code];
132:         }
133:         return $code;
134:     }
135: 
136:     /**
137:      * Get full list of codes with their description
138:      *
139:      * @return &array
140:      */
141:     public function &getTransactionEvents()
142:     {
143:         $this->_generateEventLabels();
144:         return self::$_eventList;
145:     }
146: 
147:     /**
148:      * Return description of "Debit or Credit" value
149:      * If no code specified, return full list of codes with their description
150:      *
151:      * @param string code
152:      * @return string|array
153:      */
154:     public function getDebitCreditText($code = null)
155:     {
156:         $options = array(
157:             'CR' => Mage::helper('paypal')->__('Credit'),
158:             'DR' => Mage::helper('paypal')->__('Debit'),
159:         );
160:         if($code === null) {
161:             return $options;
162:         }
163:         if (isset($options[$code])) {
164:             return $options[$code];
165:         }
166:         return $code;
167:     }
168: 
169:     /**
170:      * Invoke casting some amounts
171:      *
172:      * @param mixed $key
173:      * @param mixed $index
174:      * @return mixed
175:      */
176:     public function getData($key = '', $index = null)
177:     {
178:         $this->_castAmount('fee_amount', 'fee_debit_or_credit');
179:         $this->_castAmount('gross_transaction_amount', 'transaction_debit_or_credit');
180:         return parent::getData($key, $index);
181:     }
182: 
183:     /**
184:      * Cast amounts of the specified keys
185:      *
186:      * PayPal settlement reports contain amounts in cents, hence the values need to be divided by 100
187:      * Also if the "credit" value is detected, it will be casted to negative amount
188:      *
189:      * @param string $key
190:      * @param string $creditKey
191:      */
192:     public function _castAmount($key, $creditKey)
193:     {
194:         if (isset($this->_castedAmounts[$key]) || !isset($this->_data[$key]) || !isset($this->_data[$creditKey])) {
195:             return;
196:         }
197:         if (empty($this->_data[$key])) {
198:             return;
199:         }
200:         $amount = $this->_data[$key] / 100;
201:         if ('CR' === $this->_data[$creditKey]) {
202:             $amount = -1 * $amount;
203:         }
204:         $this->_data[$key] = $amount;
205:         $this->_castedAmounts[$key] = true;
206:     }
207: 
208:     /**
209:      * Fill/translate and sort all event codes/labels
210:      */
211:     protected function _generateEventLabels()
212:     {
213:         if (!self::$_eventList) {
214:             self::$_eventList = array(
215:             'T0000' => Mage::helper('paypal')->__('General: received payment of a type not belonging to the other T00xx categories'),
216:             'T0001' => Mage::helper('paypal')->__('Mass Pay Payment'),
217:             'T0002' => Mage::helper('paypal')->__('Subscription Payment, either payment sent or payment received'),
218:             'T0003' => Mage::helper('paypal')->__('Preapproved Payment (BillUser API), either sent or received'),
219:             'T0004' => Mage::helper('paypal')->__('eBay Auction Payment'),
220:             'T0005' => Mage::helper('paypal')->__('Direct Payment API'),
221:             'T0006' => Mage::helper('paypal')->__('Express Checkout APIs'),
222:             'T0007' => Mage::helper('paypal')->__('Website Payments Standard Payment'),
223:             'T0008' => Mage::helper('paypal')->__('Postage Payment to either USPS or UPS'),
224:             'T0009' => Mage::helper('paypal')->__('Gift Certificate Payment: purchase of Gift Certificate'),
225:             'T0010' => Mage::helper('paypal')->__('Auction Payment other than through eBay'),
226:             'T0011' => Mage::helper('paypal')->__('Mobile Payment (made via a mobile phone)'),
227:             'T0012' => Mage::helper('paypal')->__('Virtual Terminal Payment'),
228:             'T0100' => Mage::helper('paypal')->__('General: non-payment fee of a type not belonging to the other T01xx categories'),
229:             'T0101' => Mage::helper('paypal')->__('Fee: Web Site Payments Pro Account Monthly'),
230:             'T0102' => Mage::helper('paypal')->__('Fee: Foreign ACH Withdrawal'),
231:             'T0103' => Mage::helper('paypal')->__('Fee: WorldLink Check Withdrawal'),
232:             'T0104' => Mage::helper('paypal')->__('Fee: Mass Pay Request'),
233:             'T0200' => Mage::helper('paypal')->__('General Currency Conversion'),
234:             'T0201' => Mage::helper('paypal')->__('User-initiated Currency Conversion'),
235:             'T0202' => Mage::helper('paypal')->__('Currency Conversion required to cover negative balance'),
236:             'T0300' => Mage::helper('paypal')->__('General Funding of PayPal Account '),
237:             'T0301' => Mage::helper('paypal')->__('PayPal Balance Manager function of PayPal account'),
238:             'T0302' => Mage::helper('paypal')->__('ACH Funding for Funds Recovery from Account Balance'),
239:             'T0303' => Mage::helper('paypal')->__('EFT Funding (German banking)'),
240:             'T0400' => Mage::helper('paypal')->__('General Withdrawal from PayPal Account'),
241:             'T0401' => Mage::helper('paypal')->__('AutoSweep'),
242:             'T0500' => Mage::helper('paypal')->__('General: Use of PayPal account for purchasing as well as receiving payments'),
243:             'T0501' => Mage::helper('paypal')->__('Virtual PayPal Debit Card Transaction'),
244:             'T0502' => Mage::helper('paypal')->__('PayPal Debit Card Withdrawal from ATM'),
245:             'T0503' => Mage::helper('paypal')->__('Hidden Virtual PayPal Debit Card Transaction'),
246:             'T0504' => Mage::helper('paypal')->__('PayPal Debit Card Cash Advance'),
247:             'T0600' => Mage::helper('paypal')->__('General: Withdrawal from PayPal Account'),
248:             'T0700' => Mage::helper('paypal')->__('General (Purchase with a credit card)'),
249:             'T0701' => Mage::helper('paypal')->__('Negative Balance'),
250:             'T0800' => Mage::helper('paypal')->__('General: bonus of a type not belonging to the other T08xx categories'),
251:             'T0801' => Mage::helper('paypal')->__('Debit Card Cash Back'),
252:             'T0802' => Mage::helper('paypal')->__('Merchant Referral Bonus'),
253:             'T0803' => Mage::helper('paypal')->__('Balance Manager Account Bonus'),
254:             'T0804' => Mage::helper('paypal')->__('PayPal Buyer Warranty Bonus'),
255:             'T0805' => Mage::helper('paypal')->__('PayPal Protection Bonus'),
256:             'T0806' => Mage::helper('paypal')->__('Bonus for first ACH Use'),
257:             'T0900' => Mage::helper('paypal')->__('General Redemption'),
258:             'T0901' => Mage::helper('paypal')->__('Gift Certificate Redemption'),
259:             'T0902' => Mage::helper('paypal')->__('Points Incentive Redemption'),
260:             'T0903' => Mage::helper('paypal')->__('Coupon Redemption'),
261:             'T0904' => Mage::helper('paypal')->__('Reward Voucher Redemption'),
262:             'T1000' => Mage::helper('paypal')->__('General. Product no longer supported'),
263:             'T1100' => Mage::helper('paypal')->__('General: reversal of a type not belonging to the other T11xx categories'),
264:             'T1101' => Mage::helper('paypal')->__('ACH Withdrawal'),
265:             'T1102' => Mage::helper('paypal')->__('Debit Card Transaction'),
266:             'T1103' => Mage::helper('paypal')->__('Reversal of Points Usage'),
267:             'T1104' => Mage::helper('paypal')->__('ACH Deposit (Reversal)'),
268:             'T1105' => Mage::helper('paypal')->__('Reversal of General Account Hold'),
269:             'T1106' => Mage::helper('paypal')->__('Account-to-Account Payment, initiated by PayPal'),
270:             'T1107' => Mage::helper('paypal')->__('Payment Refund initiated by merchant'),
271:             'T1108' => Mage::helper('paypal')->__('Fee Reversal'),
272:             'T1110' => Mage::helper('paypal')->__('Hold for Dispute Investigation'),
273:             'T1111' => Mage::helper('paypal')->__('Reversal of hold for Dispute Investigation'),
274:             'T1200' => Mage::helper('paypal')->__('General: adjustment of a type not belonging to the other T12xx categories'),
275:             'T1201' => Mage::helper('paypal')->__('Chargeback'),
276:             'T1202' => Mage::helper('paypal')->__('Reversal'),
277:             'T1203' => Mage::helper('paypal')->__('Charge-off'),
278:             'T1204' => Mage::helper('paypal')->__('Incentive'),
279:             'T1205' => Mage::helper('paypal')->__('Reimbursement of Chargeback'),
280:             'T1300' => Mage::helper('paypal')->__('General (Authorization)'),
281:             'T1301' => Mage::helper('paypal')->__('Reauthorization'),
282:             'T1302' => Mage::helper('paypal')->__('Void'),
283:             'T1400' => Mage::helper('paypal')->__('General (Dividend)'),
284:             'T1500' => Mage::helper('paypal')->__('General: temporary hold of a type not belonging to the other T15xx categories'),
285:             'T1501' => Mage::helper('paypal')->__('Open Authorization'),
286:             'T1502' => Mage::helper('paypal')->__('ACH Deposit (Hold for Dispute or Other Investigation)'),
287:             'T1503' => Mage::helper('paypal')->__('Available Balance'),
288:             'T1600' => Mage::helper('paypal')->__('Funding'),
289:             'T1700' => Mage::helper('paypal')->__('General: Withdrawal to Non-Bank Entity'),
290:             'T1701' => Mage::helper('paypal')->__('WorldLink Withdrawal'),
291:             'T1800' => Mage::helper('paypal')->__('Buyer Credit Payment'),
292:             'T1900' => Mage::helper('paypal')->__('General Adjustment without businessrelated event'),
293:             'T2000' => Mage::helper('paypal')->__('General (Funds Transfer from PayPal Account to Another)'),
294:             'T2001' => Mage::helper('paypal')->__('Settlement Consolidation'),
295:             'T9900' => Mage::helper('paypal')->__('General: event not yet categorized'),
296:             );
297:             asort(self::$_eventList);
298:         }
299:     }
300: }
301: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0