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_Paygate_Adminhtml_Paygate_Authorizenet_PaymentController
  • Mage_Paygate_Authorizenet_PaymentController
  • Mage_Paygate_Block_Authorizenet_Form_Cc
  • Mage_Paygate_Block_Authorizenet_Info_Cc
  • Mage_Paygate_Helper_Data
  • Mage_Paygate_Model_Authorizenet
  • Mage_Paygate_Model_Authorizenet_Cards
  • Mage_Paygate_Model_Authorizenet_Debug
  • Mage_Paygate_Model_Authorizenet_Result
  • Mage_Paygate_Model_Authorizenet_Source_Cctype
  • Mage_Paygate_Model_Authorizenet_Source_PaymentAction
  • Mage_Paygate_Model_Mysql4_Authorizenet_Debug
  • Mage_Paygate_Model_Mysql4_Authorizenet_Debug_Collection
  • Mage_Paygate_Model_Resource_Authorizenet_Debug
  • Mage_Paygate_Model_Resource_Authorizenet_Debug_Collection
  • 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_Paygate
 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: class Mage_Paygate_Block_Authorizenet_Form_Cc extends Mage_Payment_Block_Form
 28: {
 29:     /**
 30:      * Set block template
 31:      */
 32:     protected function _construct()
 33:     {
 34:         parent::_construct();
 35:         $this->setTemplate('paygate/form/cc.phtml');
 36:     }
 37: 
 38:     /**
 39:      * Retreive payment method form html
 40:      *
 41:      * @return string
 42:      */
 43:     public function getMethodFormBlock()
 44:     {
 45:         return $this->getLayout()->createBlock('payment/form_cc')
 46:             ->setMethod($this->getMethod());
 47:     }
 48: 
 49:     /**
 50:      * Cards info block
 51:      *
 52:      * @return string
 53:      */
 54:     public function getCardsBlock()
 55:     {
 56:         return $this->getLayout()->createBlock('paygate/authorizenet_info_cc')
 57:             ->setMethod($this->getMethod())
 58:             ->setInfo($this->getMethod()->getInfoInstance())
 59:             ->setCheckoutProgressBlock(false)
 60:             ->setHideTitle(true);
 61:     }
 62: 
 63:     /**
 64:      * Return url to cancel controller
 65:      *
 66:      * @return string
 67:      */
 68:     public function getCancelUrl()
 69:     {
 70:         return $this->getUrl('paygate/authorizenet_payment/cancel');
 71:     }
 72: 
 73:     /**
 74:      * Return url to admin cancel controller from admin url model
 75:      *
 76:      * @return string
 77:      */
 78:     public function getAdminCancelUrl()
 79:     {
 80:         return Mage::getModel('adminhtml/url')->getUrl('adminhtml/paygate_authorizenet_payment/cancel');
 81:     }
 82: 
 83:     /**
 84:      * Render block HTML
 85:      *
 86:      * @return string
 87:      */
 88:     protected function _toHtml()
 89:     {
 90:         $this->setChild('cards', $this->getCardsBlock());
 91:         $this->setChild('method_form_block', $this->getMethodFormBlock());
 92:         return parent::_toHtml();
 93:     }
 94: 
 95:     /**
 96:      * Get notice message
 97:      *
 98:      * @return string
 99:      */
100:     public function showNoticeMessage($message)
101:     {
102:         return $this->getLayout()->getMessagesBlock()
103:             ->addNotice($this->__($message))
104:             ->getGroupedHtml();
105:     }
106: 
107:     /**
108:      * Return partial authorization confirmation message and unset it in payment model
109:      *
110:      * @return string
111:      */
112:     public function getPartialAuthorizationConfirmationMessage()
113:     {
114:         $lastActionState = $this->getMethod()->getPartialAuthorizationLastActionState();
115:         if ($lastActionState == Mage_Paygate_Model_Authorizenet::PARTIAL_AUTH_LAST_SUCCESS) {
116:             $this->getMethod()->unsetPartialAuthorizationLastActionState();
117:             return Mage::helper('paygate')->__('The amount on your credit card is insufficient to complete your purchase. The available amount has been put on hold. To complete your purchase click OK and specify additional credit card number. To cancel the purchase and release the amount on hold, click Cancel.');
118:         } elseif ($lastActionState == Mage_Paygate_Model_Authorizenet::PARTIAL_AUTH_LAST_DECLINED) {
119:             $this->getMethod()->unsetPartialAuthorizationLastActionState();
120:             return Mage::helper('paygate')->__('Your credit card has been declined. Click OK to specify another credit card to complete your purchase. Click Cancel to release the amount on hold and select another payment method.');
121:         }
122:         return false;;
123:     }
124: 
125:     /**
126:      * Return partial authorization form message and unset it in payment model
127:      *
128:      * @return string
129:      */
130:     public function getPartialAuthorizationFormMessage()
131:     {
132:         $lastActionState = $this->getMethod()->getPartialAuthorizationLastActionState();
133:         $message = false;
134:         switch ($lastActionState) {
135:             case Mage_Paygate_Model_Authorizenet::PARTIAL_AUTH_ALL_CANCELED:
136:                 $message = Mage::helper('paygate')->__('Your payment has been cancelled. All authorized amounts have been released.');
137:                 break;
138:             case Mage_Paygate_Model_Authorizenet::PARTIAL_AUTH_CARDS_LIMIT_EXCEEDED:
139:                 $message = Mage::helper('paygate')->__('You have reached the maximum number of credit cards that can be used for one payment. The available amounts on all used cards were insufficient to complete payment. The payment has been cancelled and amounts on hold have been released.');
140:                 break;
141:             case Mage_Paygate_Model_Authorizenet::PARTIAL_AUTH_DATA_CHANGED:
142:                 $message = Mage::helper('paygate')->__('Your order has not been placed, because contents of the shopping cart and/or address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process for your recent cart contents.');
143:                 break;
144:         }
145:         if ($message) {
146:             $this->getMethod()->unsetPartialAuthorizationLastActionState();
147:         }
148:         return $message;
149:     }
150: 
151:     /**
152:      * Return cancel confirmation message
153:      *
154:      * @return string
155:      */
156:     public function getCancelConfirmationMessage()
157:     {
158:         return $this->__('Are you sure you want to cancel your payment? Click OK to cancel your payment and release the amount on hold. Click Cancel to enter another credit card and continue with your payment.');
159:     }
160: 
161:     /**
162:      * Return flag - is partial authorization process started
163:      *
164:      * @return string
165:      */
166:     public function isPartialAuthorization()
167:     {
168:         return $this->getMethod()->isPartialAuthorization();
169:     }
170: 
171:     /**
172:      * Return HTML content for creating admin panel`s button
173:      *
174:      * @return string
175:      */
176:     public function getCancelButtonHtml()
177:     {
178:         $cancelButton = $this->getLayout()->createBlock('adminhtml/widget_button')
179:             ->setData(array(
180:                 'id'      => 'payment_cancel',
181:                 'label'   => Mage::helper('paygate')->__('Cancel'),
182:                 'onclick' => 'cancelPaymentAuthorizations()'
183:             ));
184:         return $cancelButton->toHtml();
185:     }
186: }
187: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0