Skip to content
Browse files

2.0.0.0-dev66

* GitHub requests:
  * [#134] (#134) Fixed a typo in "Vorarlberg" region of Austria (was Voralberg)
* Fixed bugs:
  * Fixed an issue with the "Add to Cart" button on the MAP popup of compound products
  * Fixed an issue where the "Add Address" button for Customer in Admin was broken
  * Fixed an issue where predefined data are not loaded for a newsletter when it is added to a queue
* Indexer implementation:
  * Implemented a new optimized Catalog Category Product Indexer
  * Implemented a new optimized Catalog Category Flat Indexer
  * Implemented a new optimized Catalog Product Flat Indexer
* Modularity improvements:
  * Moved all Configurable Product functionality to a newly created ConfigurableProduct module
  * Moved the Shortcut Buttons abstraction from PayPal to Catalog
  * Moved the Recurring profile functionality to a separate module
  * Moved the Billing Agreements functionality to the PayPal module
  * Finalized the work on resolving dependencies between the Multishipping module, and all other modules. Module can be removed without any impact on the system
* Customer Service usage:
 * Updated Customer Group Grid to use Customer Service for data retrieving and filtering
 * Updated CustomerMetadataService::getAttributeMetadata to throw an exception if invalid code is provided
* Unified the format of specifying arguments for class constructors in DI and in Layout configuration:
  * A common xsd schema is being used for defining simple types. Layout and DI customize common types with their specific ones
  * Argument processing is unified, and moved to library
  • Loading branch information...
1 parent 4ca7da2 commit d5d8091f8d744418f8723fd7c59f60909556b9f2 @magento-team magento-team committed Feb 21, 2014
Showing with 3,492 additions and 1,929 deletions.
  1. +26 −1 CHANGELOG.md
  2. +6 −0 app/code/Magento/AdminNotification/Block/Inbox.php
  3. +2 −0 app/code/Magento/AdminNotification/Block/System/Messages.php
  4. +8 −6 app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php
  5. +1 −2 app/code/Magento/AdminNotification/Block/ToolbarEntry.php
  6. +21 −1 app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php
  7. +3 −4 app/code/Magento/AdminNotification/Controller/Adminhtml/Survey.php
  8. +3 −1 app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message.php
  9. +7 −4 app/code/Magento/AdminNotification/Helper/Data.php
  10. +4 −3 app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php
  11. +7 −5 app/code/Magento/AdminNotification/Model/Feed.php
  12. +18 −15 app/code/Magento/AdminNotification/Model/Inbox.php
  13. +2 −2 app/code/Magento/AdminNotification/Model/NotificationService.php
  14. +2 −3 app/code/Magento/AdminNotification/Model/Observer.php
  15. +4 −4 app/code/Magento/AdminNotification/Model/Resource/Inbox.php
  16. +4 −3 app/code/Magento/AdminNotification/Model/Resource/Inbox/Collection/Critical.php
  17. +5 −4 app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php
  18. +1 −0 app/code/Magento/AdminNotification/Model/Survey.php
  19. +1 −0 app/code/Magento/AdminNotification/Model/System/MessageList.php
  20. +11 −11 app/code/Magento/AdminNotification/etc/adminhtml/di.xml
  21. +6 −3 app/code/Magento/Authorizenet/Block/Authorizenet/Form/Cc.php
  22. +5 −3 app/code/Magento/Authorizenet/Block/Authorizenet/Info/Cc.php
  23. +5 −6 app/code/Magento/Authorizenet/Block/Directpost/Form.php
  24. +5 −1 app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php
  25. +4 −6 app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment.php
  26. +3 −2 app/code/Magento/Authorizenet/Controller/Authorizenet/Payment.php
  27. +11 −5 app/code/Magento/Authorizenet/Controller/Directpost/Payment.php
  28. +4 −6 app/code/Magento/Authorizenet/Helper/Backend.php
  29. +5 −5 app/code/Magento/Authorizenet/Helper/Data.php
  30. +81 −55 app/code/Magento/Authorizenet/Model/Authorizenet.php
  31. +11 −8 app/code/Magento/Authorizenet/Model/Authorizenet/Cards.php
  32. +4 −5 app/code/Magento/Authorizenet/Model/Authorizenet/Debug.php
  33. +5 −5 app/code/Magento/Authorizenet/Model/Authorizenet/Source/Cctype.php
  34. +5 −3 app/code/Magento/Authorizenet/Model/Authorizenet/Source/PaymentAction.php
  35. +45 −24 app/code/Magento/Authorizenet/Model/Directpost.php
  36. +5 −8 app/code/Magento/Authorizenet/Model/Directpost/Observer.php
  37. +9 −9 app/code/Magento/Authorizenet/Model/Directpost/Request.php
  38. +2 −1 app/code/Magento/Authorizenet/Model/Directpost/Session.php
  39. +3 −6 app/code/Magento/Authorizenet/Model/Resource/Authorizenet/Debug.php
  40. +3 −6 app/code/Magento/Authorizenet/Model/Resource/Authorizenet/Debug/Collection.php
  41. +10 −10 app/code/Magento/Authorizenet/etc/adminhtml/di.xml
  42. +11 −13 app/code/Magento/Authorizenet/etc/di.xml
  43. +15 −15 app/code/Magento/Authorizenet/etc/frontend/di.xml
  44. +6 −5 app/code/Magento/Authz/Model/UserIdentifier.php
  45. +3 −2 app/code/Magento/Authz/Model/UserLocator/Admin.php
  46. +25 −9 app/code/Magento/Authz/Service/AuthorizationV1.php
  47. +3 −1 app/code/Magento/Authz/Service/AuthorizationV1Interface.php
  48. +0 −7 app/code/Magento/Backend/App/Router/DefaultRouter.php
  49. +8 −20 app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php
  50. +56 −62 app/code/Magento/Backend/etc/adminhtml/di.xml
  51. +93 −105 app/code/Magento/Backend/etc/di.xml
  52. +12 −4 app/code/Magento/Backup/Block/Adminhtml/Backup.php
  53. +5 −5 app/code/Magento/Backup/Block/Adminhtml/Dialogs.php
  54. +8 −7 app/code/Magento/Backup/Controller/Adminhtml/Index.php
  55. +10 −9 app/code/Magento/Backup/Helper/Data.php
  56. +16 −15 app/code/Magento/Backup/Model/Backup.php
  57. +2 −3 app/code/Magento/Backup/Model/Config/Backend/Cron.php
  58. +2 −7 app/code/Magento/Backup/Model/Config/Source/Type.php
  59. +27 −14 app/code/Magento/Backup/Model/Db.php
  60. +3 −2 app/code/Magento/Backup/Model/Fs/Collection.php
  61. +16 −16 app/code/Magento/Backup/Model/Resource/Db.php
  62. +5 −2 app/code/Magento/Backup/Model/Resource/Helper.php
  63. +6 −8 app/code/Magento/Backup/etc/di.xml
  64. +3 −8 app/code/Magento/Bundle/Model/Product/Attribute/Source/Price/View.php
  65. +1 −1 app/code/Magento/Bundle/Model/Product/Type.php
  66. +1 −1 app/code/Magento/Bundle/Model/Resource/Indexer/Price.php
  67. +1 −1 app/code/Magento/Bundle/Model/Resource/Indexer/Stock.php
  68. +6 −13 app/code/Magento/Bundle/etc/adminhtml/di.xml
  69. +19 −19 app/code/Magento/Bundle/etc/di.xml
  70. +0 −5 app/code/Magento/Bundle/sql/bundle_setup/install-1.6.0.0.php
  71. +2 −2 ...atalog_product_view_type_configurable.xml → Bundle/view/adminhtml/layout/catalog_product_new.xml}
  72. +34 −0 app/code/Magento/Bundle/view/adminhtml/product/stock/disabler.phtml
  73. +4 −4 app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php
  74. +2 −5 app/code/Magento/Captcha/Controller/Adminhtml/Refresh.php
  75. +2 −5 app/code/Magento/Captcha/Controller/Refresh.php
  76. +2 −3 app/code/Magento/Captcha/Model/Cron.php
  77. +9 −10 app/code/Magento/Captcha/Model/DefaultModel.php
  78. +1 −2 app/code/Magento/Captcha/Model/ModelInterface.php
  79. +10 −12 app/code/Magento/Captcha/Model/Observer.php
  80. +4 −6 app/code/Magento/Captcha/Model/Resource/Log.php
  81. +8 −10 app/code/Magento/Captcha/etc/adminhtml/di.xml
  82. +7 −7 app/code/Magento/Captcha/etc/di.xml
  83. +1 −8 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php
  84. +10 −36 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php
  85. +0 −194 app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php
  86. +0 −24 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php
  87. +3 −3 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php
  88. +0 −12 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php
  89. +3 −3 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php
  90. +3 −3 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php
  91. +0 −1 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php
  92. +3 −3 app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php
  93. +0 −75 app/code/Magento/Catalog/Block/Adminhtml/System/Config/Form/Field/Select/Flatproduct.php
  94. +2 −4 app/code/Magento/Catalog/Block/Product/View/Options.php
  95. +51 −292 app/code/Magento/Catalog/Controller/Adminhtml/Product.php
  96. +14 −5 app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php
  97. +0 −14 app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php
  98. +111 −0 app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php
  99. +24 −25 ...yout/Factory.php → Catalog/Controller/Adminhtml/Product/Initialization/Helper/HandlerFactory.php}
  100. +34 −0 app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/HandlerInterface.php
  101. +63 −0 ...e/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Handler/Composite.php
  102. +1 −10 app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php
  103. +0 −12 app/code/Magento/Catalog/Helper/Product.php
  104. +0 −41 app/code/Magento/Catalog/Helper/Product/Configuration.php
  105. +4 −36 app/code/Magento/Catalog/Helper/Product/Flat.php
  106. +490 −0 app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php
  107. +26 −32 ...nto/{Core/Model/Layout/Argument/Updater.php → Catalog/Model/Attribute/LockValidatorComposite.php}
  108. +41 −0 app/code/Magento/Catalog/Model/Attribute/LockValidatorInterface.php
  109. +30 −2 app/code/Magento/Catalog/Model/Category.php
  110. +0 −267 app/code/Magento/Catalog/Model/Category/Indexer/Product.php
  111. +16 −6 app/code/Magento/Catalog/Model/Entity/Attribute.php
  112. +69 −0 app/code/Magento/Catalog/Model/Entity/Product/Attribute/Group/AttributeMapper.php
  113. +39 −0 app/code/Magento/Catalog/Model/Entity/Product/Attribute/Group/AttributeMapperInterface.php
  114. +0 −90 app/code/Magento/Catalog/Model/Index.php
  115. +2 −5 app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Rows.php
  116. +52 −6 app/code/Magento/Catalog/Model/Indexer/Category/Flat/Plugin/StoreGroup.php
  117. +7 −14 app/code/Magento/Catalog/Model/Indexer/Category/Flat/Plugin/StoreView.php
  118. +123 −0 app/code/Magento/Catalog/Model/Indexer/Category/Product.php
  119. +609 −0 app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php
  120. +108 −0 app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php
  121. +126 −0 app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php
  122. +77 −0 app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/RowsFactory.php
  123. +74 −0 app/code/Magento/Catalog/Model/Indexer/Category/Product/Plugin/IndexerState.php
  124. +99 −0 app/code/Magento/Catalog/Model/Indexer/Category/Product/Plugin/MviewState.php
  125. +27 −15 ...to/Catalog/Model/Indexer/Category/{Flat/Plugin/AbstractStore.php → Product/Plugin/StoreGroup.php}
  126. +38 −0 app/code/Magento/Catalog/Model/Indexer/Category/Product/Plugin/StoreView.php
  127. +46 −0 app/code/Magento/Catalog/Model/Indexer/Product/Category.php
  128. +111 −0 app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php
  129. +44 −0 app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/RowsFactory.php
  130. +96 −0 app/code/Magento/Catalog/Model/Indexer/Product/Flat.php
Sorry, we could not display the entire diff because too many files (1,545) changed.
View
27 CHANGELOG.md
@@ -1,3 +1,28 @@
+2.0.0.0-dev66
+=============
+* GitHub requests:
+ * [#134] (https://github.com/magento/magento2/pull/134) Fixed a typo in "Vorarlberg" region of Austria (was Voralberg)
+* Fixed bugs:
+ * Fixed an issue with the "Add to Cart" button on the MAP popup of compound products
+ * Fixed an issue where the "Add Address" button for Customer in Admin was broken
+ * Fixed an issue where predefined data are not loaded for a newsletter when it is added to a queue
+* Indexer implementation:
+ * Implemented a new optimized Catalog Category Product Indexer
+ * Implemented a new optimized Catalog Category Flat Indexer
+ * Implemented a new optimized Catalog Product Flat Indexer
+* Modularity improvements:
+ * Moved all Configurable Product functionality to a newly created ConfigurableProduct module
+ * Moved the Shortcut Buttons abstraction from PayPal to Catalog
+ * Moved the Recurring profile functionality to a separate module
+ * Moved the Billing Agreements functionality to the PayPal module
+ * Finalized the work on resolving dependencies between the Multishipping module, and all other modules. Module can be removed without any impact on the system
+* Customer Service usage:
+ * Updated Customer Group Grid to use Customer Service for data retrieving and filtering
+ * Updated CustomerMetadataService::getAttributeMetadata to throw an exception if invalid code is provided
+* Unified the format of specifying arguments for class constructors in DI and in Layout configuration:
+ * A common xsd schema is being used for defining simple types. Layout and DI customize common types with their specific ones
+ * Argument processing is unified, and moved to library
+
2.0.0.0-dev65
=============
* Fixed bugs:
@@ -21,7 +46,7 @@
* Improvements in code coverage calculation:
* Added code coverage calculation in the clover xml format for unit tests
* GitHub requests:
- * [#377] (https://github.com/magento/magento2/issues/377) Remove and avoid javascript eval() calls
+ * [#377] (https://github.com/magento/magento2/issues/377) Remove and avoid javascript eval() calls
* [#319] (https://github.com/magento/magento2/issues/319) No message was displayed when product added to shopping cart.
* [#367] (https://github.com/magento/magento2/issues/367) Improve the error message from the contact form
* [#469] (https://github.com/magento/magento2/issues/469) Can't change prices on different websites for custom options
View
6 app/code/Magento/AdminNotification/Block/Inbox.php
@@ -29,6 +29,9 @@
class Inbox extends \Magento\Backend\Block\Widget\Grid\Container
{
+ /**
+ * @return void
+ */
protected function _construct()
{
$this->_controller = 'adminhtml';
@@ -37,6 +40,9 @@ protected function _construct()
parent::_construct();
}
+ /**
+ * @return $this
+ */
protected function _prepareLayout()
{
parent::_prepareLayout();
View
2 app/code/Magento/AdminNotification/Block/System/Messages.php
@@ -55,6 +55,8 @@ public function __construct(
}
/**
+ * Prepare html output
+ *
* @return string
*/
protected function _toHtml()
View
14 app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php
@@ -23,6 +23,8 @@
*/
namespace Magento\AdminNotification\Block\System\Messages;
+use Magento\AdminNotification\Model\System\MessageInterface;
+
class UnreadMessagePopup extends \Magento\Backend\Block\Template
{
/**
@@ -31,8 +33,8 @@ class UnreadMessagePopup extends \Magento\Backend\Block\Template
* @var array
*/
protected $_itemClasses = array(
- \Magento\AdminNotification\Model\System\MessageInterface::SEVERITY_CRITICAL => 'error',
- \Magento\AdminNotification\Model\System\MessageInterface::SEVERITY_MAJOR => 'warning'
+ MessageInterface::SEVERITY_CRITICAL => 'error',
+ MessageInterface::SEVERITY_MAJOR => 'warning'
);
/**
@@ -72,7 +74,7 @@ protected function _toHtml()
/**
* Retrieve list of unread messages
*
- * @return mixed
+ * @return MessageInterface[]
*/
public function getUnreadMessages()
{
@@ -97,10 +99,10 @@ public function getPopupTitle()
/**
* Retrieve item class by severity
*
- * @param \Magento\AdminNotification\Model\System\MessageInterface $message
- * @return mixed
+ * @param MessageInterface $message
+ * @return string
*/
- public function getItemClass(\Magento\AdminNotification\Model\System\MessageInterface $message)
+ public function getItemClass(MessageInterface $message)
{
return $this->_itemClasses[$message->getSeverity()];
}
View
3 app/code/Magento/AdminNotification/Block/ToolbarEntry.php
@@ -23,6 +23,7 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
+namespace Magento\AdminNotification\Block;
/**
* Toolbar entry that shows latest notifications
@@ -31,8 +32,6 @@
* @package Magento_AdminNotification
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\AdminNotification\Block;
-
class ToolbarEntry extends \Magento\Backend\Block\Template
{
/**
View
22 app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php
@@ -29,6 +29,9 @@
class Notification extends \Magento\Backend\App\AbstractAction
{
+ /**
+ * @return void
+ */
public function indexAction()
{
$this->_title->add(__('Notifications'));
@@ -42,6 +45,9 @@ public function indexAction()
$this->_view->renderLayout();
}
+ /**
+ * @return void
+ */
public function markAsReadAction()
{
$notificationId = (int)$this->getRequest()->getParam('id');
@@ -67,6 +73,8 @@ public function markAsReadAction()
/**
* Mark notification as read (AJAX action)
+ *
+ * @return void
*/
public function ajaxMarkAsReadAction()
{
@@ -87,6 +95,9 @@ public function ajaxMarkAsReadAction()
);
}
+ /**
+ * @return void
+ */
public function massMarkAsReadAction()
{
$ids = $this->getRequest()->getParam('notification');
@@ -115,6 +126,9 @@ public function massMarkAsReadAction()
$this->_redirect('adminhtml/*/');
}
+ /**
+ * @return void
+ */
public function removeAction()
{
if ($id = $this->getRequest()->getParam('id')) {
@@ -123,7 +137,7 @@ public function removeAction()
if (!$model->getId()) {
$this->_redirect('adminhtml/*/');
- return ;
+ return;
}
try {
@@ -147,6 +161,9 @@ public function removeAction()
$this->_redirect('adminhtml/*/');
}
+ /**
+ * @return void
+ */
public function massRemoveAction()
{
$ids = $this->getRequest()->getParam('notification');
@@ -172,6 +189,9 @@ public function massRemoveAction()
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*')));
}
+ /**
+ * @return bool
+ */
protected function _isAllowed()
{
switch ($this->getRequest()->getActionName()) {
View
7 app/code/Magento/AdminNotification/Controller/Adminhtml/Survey.php
@@ -23,7 +23,7 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
+namespace Magento\AdminNotification\Controller\Adminhtml;
/**
* Adminhtml Survey Action
@@ -32,13 +32,12 @@
* @package Magento_Adminhtml
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\AdminNotification\Controller\Adminhtml;
-
class Survey extends \Magento\Backend\App\Action
{
/**
* Index Action
*
+ * @return void
*/
public function indexAction()
{
@@ -51,7 +50,7 @@ public function indexAction()
/**
* Check if user has enough privileges
*
- * @return boolean
+ * @return bool
*/
protected function _isAllowed()
{
View
4 app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message.php
@@ -21,11 +21,13 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
namespace Magento\AdminNotification\Controller\Adminhtml\System;
class Message extends \Magento\Backend\App\AbstractAction
{
+ /**
+ * @return void
+ */
public function listAction()
{
$severity = $this->getRequest()->getParam('severity');
View
11 app/code/Magento/AdminNotification/Helper/Data.php
@@ -23,7 +23,7 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
+namespace Magento\AdminNotification\Helper;
/**
* AdminNotification Data helper
@@ -32,8 +32,6 @@
* @package Magento_AdminNotification
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\AdminNotification\Helper;
-
class Data extends \Magento\App\Helper\AbstractHelper
{
const XML_PATH_POPUP_URL = 'system/adminnotification/popup_url';
@@ -60,7 +58,7 @@ class Data extends \Magento\App\Helper\AbstractHelper
protected $_latestNotice;
/**
- * count of unread notes by type
+ * Count of unread notes by type
*
* @var array
*/
@@ -76,6 +74,11 @@ class Data extends \Magento\App\Helper\AbstractHelper
*/
protected $_inboxFactory;
+ /**
+ * @param \Magento\App\Helper\Context $context
+ * @param \Magento\Core\Model\Store\Config $coreStoreConfig
+ * @param \Magento\AdminNotification\Model\InboxFactory $inboxFactory
+ */
public function __construct(
\Magento\App\Helper\Context $context,
\Magento\Core\Model\Store\Config $coreStoreConfig,
View
7 app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php
@@ -23,7 +23,7 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
+namespace Magento\AdminNotification\Model\Config\Source;
/**
* AdminNotification update frequency source
@@ -32,10 +32,11 @@
* @package Magento_AdminNotification
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\AdminNotification\Model\Config\Source;
-
class Frequency implements \Magento\Core\Model\Option\ArrayInterface
{
+ /**
+ * @return array
+ */
public function toOptionArray()
{
return array(
View
12 app/code/Magento/AdminNotification/Model/Feed.php
@@ -23,7 +23,7 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
+namespace Magento\AdminNotification\Model;
/**
* AdminNotification Feed model
@@ -32,8 +32,6 @@
* @package Magento_AdminNotification
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\AdminNotification\Model;
-
class Feed extends \Magento\Core\Model\AbstractModel
{
const XML_USE_HTTPS_PATH = 'system/adminnotification/use_https';
@@ -84,6 +82,7 @@ public function __construct(
/**
* Init model
*
+ * @return void
*/
protected function _construct()
{
@@ -107,7 +106,7 @@ public function getFeedUrl()
/**
* Check feed for modification
*
- * @return \Magento\AdminNotification\Model\Feed
+ * @return $this
*/
public function checkUpdate()
{
@@ -174,7 +173,7 @@ public function getLastUpdate()
/**
* Set last update time (now)
*
- * @return \Magento\AdminNotification\Model\Feed
+ * @return $this
*/
public function setLastUpdate()
{
@@ -212,6 +211,9 @@ public function getFeedData()
return $xml;
}
+ /**
+ * @return \SimpleXMLElement
+ */
public function getFeedXml()
{
try {
View
33 app/code/Magento/AdminNotification/Model/Inbox.php
@@ -23,6 +23,7 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
+namespace Magento\AdminNotification\Model;
/**
* AdminNotification Inbox model
@@ -48,15 +49,16 @@
* @package Magento_AdminNotification
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\AdminNotification\Model;
-
class Inbox extends \Magento\Core\Model\AbstractModel
{
const SEVERITY_CRITICAL = 1;
const SEVERITY_MAJOR = 2;
const SEVERITY_MINOR = 3;
const SEVERITY_NOTICE = 4;
+ /**
+ * @return void
+ */
protected function _construct()
{
$this->_init('Magento\AdminNotification\Model\Resource\Inbox');
@@ -65,7 +67,8 @@ protected function _construct()
/**
* Retrieve Severity collection array
*
- * @return array|string
+ * @param int|null $severity
+ * @return array|string|null
*/
public function getSeverities($severity = null)
{
@@ -89,7 +92,7 @@ public function getSeverities($severity = null)
/**
* Retrieve Latest Notice
*
- * @return \Magento\AdminNotification\Model\Inbox
+ * @return $this
*/
public function loadLatestNotice()
{
@@ -112,7 +115,7 @@ public function getNoticeStatus()
* Parse and save new data
*
* @param array $data
- * @return \Magento\AdminNotification\Model\Inbox
+ * @return $this
*/
public function parse(array $data)
{
@@ -124,11 +127,11 @@ public function parse(array $data)
*
* @param int $severity
* @param string $title
- * @param string|array $description
+ * @param string|string[] $description
* @param string $url
* @param bool $isInternal
* @throws \Magento\Core\Exception
- * @return \Magento\AdminNotification\Model\Inbox
+ * @return $this
*/
public function add($severity, $title, $description, $url = '', $isInternal = true)
{
@@ -154,10 +157,10 @@ public function add($severity, $title, $description, $url = '', $isInternal = tr
* Add critical severity message
*
* @param string $title
- * @param string|array $description
+ * @param string|string[] $description
* @param string $url
* @param bool $isInternal
- * @return \Magento\AdminNotification\Model\Inbox
+ * @return $this
*/
public function addCritical($title, $description, $url = '', $isInternal = true)
{
@@ -169,10 +172,10 @@ public function addCritical($title, $description, $url = '', $isInternal = true)
* Add major severity message
*
* @param string $title
- * @param string|array $description
+ * @param string|string[] $description
* @param string $url
* @param bool $isInternal
- * @return \Magento\AdminNotification\Model\Inbox
+ * @return $this
*/
public function addMajor($title, $description, $url = '', $isInternal = true)
{
@@ -184,10 +187,10 @@ public function addMajor($title, $description, $url = '', $isInternal = true)
* Add minor severity message
*
* @param string $title
- * @param string|array $description
+ * @param string|string[] $description
* @param string $url
* @param bool $isInternal
- * @return \Magento\AdminNotification\Model\Inbox
+ * @return $this
*/
public function addMinor($title, $description, $url = '', $isInternal = true)
{
@@ -199,10 +202,10 @@ public function addMinor($title, $description, $url = '', $isInternal = true)
* Add notice
*
* @param string $title
- * @param string|array $description
+ * @param string|string[] $description
* @param string $url
* @param bool $isInternal
- * @return \Magento\AdminNotification\Model\Inbox
+ * @return $this
*/
public function addNotice($title, $description, $url = '', $isInternal = true)
{
View
4 app/code/Magento/AdminNotification/Model/NotificationService.php
@@ -23,6 +23,7 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
+namespace Magento\AdminNotification\Model;
/**
* Notification service model
@@ -31,8 +32,6 @@
* @package Magento_AdminNotification
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\AdminNotification\Model;
-
class NotificationService
{
/**
@@ -53,6 +52,7 @@ public function __construct(
* Mark notification as read
*
* @param int $notificationId
+ * @return void
* @throws \Magento\Core\Exception
*/
public function markAsRead($notificationId)
View
5 app/code/Magento/AdminNotification/Model/Observer.php
@@ -23,7 +23,7 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
+namespace Magento\AdminNotification\Model;
/**
* AdminNotification observer
@@ -32,8 +32,6 @@
* @package Magento_AdminNotification
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\AdminNotification\Model;
-
class Observer
{
/**
@@ -62,6 +60,7 @@ public function __construct(
* Predispath admin action controller
*
* @param \Magento\Event\Observer $observer
+ * @return void
*/
public function preDispatch(\Magento\Event\Observer $observer)
{
View
8 app/code/Magento/AdminNotification/Model/Resource/Inbox.php
@@ -23,7 +23,7 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
+namespace Magento\AdminNotification\Model\Resource;
/**
* AdminNotification Inbox model
@@ -32,13 +32,12 @@
* @package Magento_AdminNotification
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\AdminNotification\Model\Resource;
-
class Inbox extends \Magento\Core\Model\Resource\Db\AbstractDb
{
/**
* AdminNotification Resource initialization
*
+ * @return void
*/
protected function _construct()
{
@@ -49,7 +48,7 @@ protected function _construct()
* Load latest notice
*
* @param \Magento\AdminNotification\Model\Inbox $object
- * @return \Magento\AdminNotification\Model\Resource\Inbox
+ * @return $this
*/
public function loadLatestNotice(\Magento\AdminNotification\Model\Inbox $object)
{
@@ -96,6 +95,7 @@ public function getNoticeStatus(\Magento\AdminNotification\Model\Inbox $object)
*
* @param \Magento\AdminNotification\Model\Inbox $object
* @param array $data
+ * @return void
*/
public function parse(\Magento\AdminNotification\Model\Inbox $object, array $data)
{
View
7 app/code/Magento/AdminNotification/Model/Resource/Inbox/Collection/Critical.php
@@ -25,19 +25,20 @@
*/
namespace Magento\AdminNotification\Model\Resource\Inbox\Collection;
-class Critical
- extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection
+class Critical extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection
{
/**
* Resource collection initialization
+ *
+ * @return void
*/
protected function _construct()
{
$this->_init('Magento\AdminNotification\Model\Inbox', 'Magento\AdminNotification\Model\Resource\Inbox');
}
/**
- * @return $this|\Magento\Core\Model\Resource\Db\Collection\AbstractCollection
+ * @return $this
*/
protected function _initSelect()
{
View
9 app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php
@@ -21,7 +21,6 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
namespace Magento\AdminNotification\Model\Resource\System\Message;
class Collection
@@ -65,6 +64,8 @@ public function __construct(
/**
* Resource collection initialization
+ *
+ * @return void
*/
protected function _construct()
{
@@ -76,7 +77,7 @@ protected function _construct()
/**
* Initialize db query
*
- * @return \Magento\Core\Model\Resource\Db\Collection\AbstractCollection|void
+ * @return void
*/
protected function _initSelect()
{
@@ -88,7 +89,7 @@ protected function _initSelect()
/**
* Initialize system messages after load
*
- * @return \Magento\Core\Model\Resource\Db\AbstractDb
+ * @return void
*/
protected function _afterLoad()
{
@@ -111,7 +112,7 @@ protected function _afterLoad()
* Set message severity filter
*
* @param int $severity
- * @return \Magento\Core\Model\Resource\Db\AbstractDb
+ * @return $this
*/
public function setSeverity($severity)
{
View
1 app/code/Magento/AdminNotification/Model/Survey.php
@@ -134,6 +134,7 @@ public function isSurveyViewed()
* Save survey viewed flag in core flag
*
* @param boolean $viewed
+ * @return void
*/
public function saveSurveyViewed($viewed)
{
View
1 app/code/Magento/AdminNotification/Model/System/MessageList.php
@@ -54,6 +54,7 @@ public function __construct(
/**
* Load messages to display
*
+ * @return void
* @throws \InvalidArgumentException
*/
protected function _loadMessages()
View
22 app/code/Magento/AdminNotification/etc/adminhtml/di.xml
@@ -23,17 +23,17 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
-->
-<config>
+<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<type name="Magento\AdminNotification\Model\System\MessageList">
- <param name="messages">
- <array>
- <item key="baseurl"><value>Magento\AdminNotification\Model\System\Message\Baseurl</value></item>
- <item key="security"><value>Magento\AdminNotification\Model\System\Message\Security</value></item>
- <item key="cacheOutdated"><value>Magento\AdminNotification\Model\System\Message\CacheOutdated</value></item>
- <item key="survey"><value>Magento\AdminNotification\Model\System\Message\Survey</value></item>
- <item key="media_synchronization_error"><value>Magento\AdminNotification\Model\System\Message\Media\Synchronization\Error</value></item>
- <item key="media_synchronization_success"><value>Magento\AdminNotification\Model\System\Message\Media\Synchronization\Success</value></item>
- </array>
- </param>
+ <arguments>
+ <argument name="messages" xsi:type="array">
+ <item name="baseurl" xsi:type="string">Magento\AdminNotification\Model\System\Message\Baseurl</item>
+ <item name="security" xsi:type="string">Magento\AdminNotification\Model\System\Message\Security</item>
+ <item name="cacheOutdated" xsi:type="string">Magento\AdminNotification\Model\System\Message\CacheOutdated</item>
+ <item name="survey" xsi:type="string">Magento\AdminNotification\Model\System\Message\Survey</item>
+ <item name="media_synchronization_error" xsi:type="string">Magento\AdminNotification\Model\System\Message\Media\Synchronization\Error</item>
+ <item name="media_synchronization_success" xsi:type="string">Magento\AdminNotification\Model\System\Message\Media\Synchronization\Success</item>
+ </argument>
+ </arguments>
</type>
</config>
View
9 app/code/Magento/Authorizenet/Block/Authorizenet/Form/Cc.php
@@ -23,11 +23,13 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
namespace Magento\Authorizenet\Block\Authorizenet\Form;
class Cc extends \Magento\Payment\Block\Form
{
+ /**
+ * @var string
+ */
protected $_template = 'Magento_Authorizenet::form/cc.phtml';
/**
@@ -90,6 +92,7 @@ protected function _toHtml()
/**
* Get notice message
*
+ * @param string $message
* @return string
*/
public function showNoticeMessage($message)
@@ -102,7 +105,7 @@ public function showNoticeMessage($message)
/**
* Return partial authorization confirmation message and unset it in payment model
*
- * @return string
+ * @return string|false
*/
public function getPartialAuthorizationConfirmationMessage()
{
@@ -156,7 +159,7 @@ public function getCancelConfirmationMessage()
/**
* Return flag - is partial authorization process started
*
- * @return string
+ * @return bool
*/
public function isPartialAuthorization()
{
View
8 app/code/Magento/Authorizenet/Block/Authorizenet/Info/Cc.php
@@ -23,7 +23,6 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
namespace Magento\Authorizenet\Block\Authorizenet\Info;
use Magento\Payment\Block\Info;
@@ -37,6 +36,9 @@ class Cc extends \Magento\Payment\Block\Info\Cc
*/
protected $_isCheckoutProgressBlockFlag = true;
+ /**
+ * @var string
+ */
protected $_template = 'Magento_Authorizenet::info/cc.phtml';
/**
@@ -74,7 +76,7 @@ public function toPdf()
/**
* Retrieve card info object
*
- * @return mixed
+ * @return \Magento\Payment\Model\Info
*/
public function getInfo()
{
@@ -90,7 +92,7 @@ public function getInfo()
* in Previously used card information block
*
* @param bool $flag
- * @return \Magento\Authorizenet\Block\Authorizenet\Info\Cc
+ * @return $this
*/
public function setCheckoutProgressBlock($flag)
{
View
11 app/code/Magento/Authorizenet/Block/Directpost/Form.php
@@ -23,18 +23,18 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
+namespace Magento\Authorizenet\Block\Directpost;
/**
* DirectPost form block
*
- * @category Magento
- * @package Magento_Authorizenet
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\Authorizenet\Block\Directpost;
-
class Form extends \Magento\Payment\Block\Form\Cc
{
+ /**
+ * @var string
+ */
protected $_template = 'directpost/info.phtml';
/**
@@ -66,7 +66,6 @@ public function __construct(
$this->_checkoutModel = $checkoutModel;
}
-
/**
* Render block HTML
* If method is not directpost - nothing to return
@@ -81,7 +80,7 @@ protected function _toHtml()
/**
* Set method info
*
- * @return \Magento\Authorizenet\Block\Directpost\Form
+ * @return $this
*/
public function setMethodInfo()
{
View
6 app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php
@@ -1,6 +1,6 @@
<?php
/**
- * Admihtml DirtectPost Payment Controller
+ * Adminhtml DirectPost Payment Controller
*
* Magento
*
@@ -82,6 +82,7 @@ protected function _getOrderCreateModel()
/**
* Send request to authorize.net
*
+ * @return void
*/
public function placeAction()
{
@@ -178,6 +179,7 @@ public function placeAction()
/**
* Retrieve params and put javascript into iframe
*
+ * @return void
*/
public function redirectAction()
{
@@ -222,6 +224,7 @@ public function redirectAction()
/**
* Return order quote by ajax
*
+ * @return void
*/
public function returnQuoteAction()
{
@@ -235,6 +238,7 @@ public function returnQuoteAction()
*
* @param bool $cancelOrder
* @param string $errorMsg
+ * @return void
*/
protected function _returnQuote($cancelOrder = false, $errorMsg = '')
{
View
10 app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment.php
@@ -23,16 +23,13 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
+namespace Magento\Authorizenet\Controller\Adminhtml\Authorizenet;
/**
* Authorize Payment Controller
*
- * @category Magento
- * @package Magento_Authorizenet
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\Authorizenet\Controller\Adminhtml\Authorizenet;
-
class Payment extends \Magento\Backend\App\Action
{
/**
@@ -54,9 +51,10 @@ public function __construct(
parent::__construct($context);
}
-
/**
- * Cancel active partail authorizations
+ * Cancel active partial authorizations
+ *
+ * @return void
*/
public function cancelAction()
{
View
5 app/code/Magento/Authorizenet/Controller/Authorizenet/Payment.php
@@ -23,7 +23,6 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
namespace Magento\Authorizenet\Controller\Authorizenet;
class Payment extends \Magento\App\Action\Action
@@ -49,7 +48,9 @@ public function __construct(
/**
- * Cancel active partail authorizations
+ * Cancel active partial authorizations
+ *
+ * @return void
*/
public function cancelAction()
{
View
16 app/code/Magento/Authorizenet/Controller/Directpost/Payment.php
@@ -23,16 +23,13 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
+namespace Magento\Authorizenet\Controller\Directpost;
/**
- * DirtectPost Payment Controller
+ * DirectPost Payment Controller
*
- * @category Magento
- * @package Magento_Authorizenet
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\Authorizenet\Controller\Directpost;
-
class Payment extends \Magento\App\Action\Action
{
/**
@@ -75,6 +72,8 @@ protected function _getDirectPostSession()
/**
* Response action.
* Action for Authorize.net SIM Relay Request.
+ *
+ * @return void
*/
public function backendResponseAction()
{
@@ -84,6 +83,8 @@ public function backendResponseAction()
/**
* Response action.
* Action for Authorize.net SIM Relay Request.
+ *
+ * @return void
*/
public function responseAction()
{
@@ -95,6 +96,7 @@ public function responseAction()
* Action for Authorize.net SIM Relay Request.
*
* @param \Magento\Authorizenet\Helper\HelperInterface $helper
+ * @return void
*/
protected function _responseAction(\Magento\Authorizenet\Helper\HelperInterface $helper)
{
@@ -143,6 +145,7 @@ protected function _responseAction(\Magento\Authorizenet\Helper\HelperInterface
/**
* Retrieve params and put javascript into iframe
*
+ * @return void
*/
public function redirectAction()
{
@@ -176,6 +179,7 @@ public function redirectAction()
/**
* Send request to authorize.net
*
+ * @return void
*/
public function placeAction()
{
@@ -203,6 +207,7 @@ public function placeAction()
/**
* Return customer quote by ajax
*
+ * @return void
*/
public function returnQuoteAction()
{
@@ -216,6 +221,7 @@ public function returnQuoteAction()
*
* @param bool $cancelOrder
* @param string $errorMsg
+ * @return void
*/
protected function _returnCustomerQuote($cancelOrder = false, $errorMsg = '')
{
View
10 app/code/Magento/Authorizenet/Helper/Backend.php
@@ -23,11 +23,10 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
namespace Magento\Authorizenet\Helper;
/**
- * Authorizenet Backend Data Helper
+ * Authorize.net Backend Data Helper
*/
class Backend extends Data
{
@@ -47,7 +46,6 @@ public function __construct(
$this->_urlBuilder = $backendUrl;
}
-
/**
* Return URL for admin area
*
@@ -73,7 +71,7 @@ public function getPlaceOrderAdminUrl()
/**
* Retrieve place order url
*
- * @param array params
+ * @param array $params
* @return string
*/
public function getSuccessOrderUrl($params)
@@ -86,9 +84,9 @@ public function getSuccessOrderUrl($params)
}
/**
- * Retrieve redirect ifrmae url
+ * Retrieve redirect iframe url
*
- * @param array params
+ * @param array $params
* @return string
*/
public function getRedirectIframeUrl($params)
View
10 app/code/Magento/Authorizenet/Helper/Data.php
@@ -23,11 +23,10 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
namespace Magento\Authorizenet\Helper;
/**
- * Authorizenet Data Helper
+ * Authorize.net Data Helper
*/
class Data extends \Magento\App\Helper\AbstractHelper implements HelperInterface
{
@@ -105,9 +104,9 @@ public function getSaveOrderUrlParams($controller)
}
/**
- * Retrieve redirect ifrmae url
+ * Retrieve redirect iframe url
*
- * @param array params
+ * @param array $params
* @return string
*/
public function getRedirectIframeUrl($params)
@@ -138,7 +137,7 @@ public function getPlaceOrderFrontUrl()
/**
* Retrieve place order url
*
- * @param array params
+ * @param array $params
* @return string
*/
public function getSuccessOrderUrl($params)
@@ -162,6 +161,7 @@ public function getSuccessOrderUrl($params)
* Needed for Admin area.
*
* @param \Magento\Sales\Model\Order $order
+ * @return void
*/
public function updateOrderEditIncrements(\Magento\Sales\Model\Order $order)
{
View
136 app/code/Magento/Authorizenet/Model/Authorizenet.php
@@ -21,7 +21,6 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
namespace Magento\Authorizenet\Model;
class Authorizenet extends \Magento\Payment\Model\Method\Cc
@@ -81,20 +80,29 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
const TRANSACTION_STATUS_EXPIRED = 'expired';
+ /**
+ * @var string
+ */
protected $_code = self::METHOD_CODE;
/**
* Form block type
+ *
+ * @var string
*/
protected $_formBlockType = 'Magento\Authorizenet\Block\Authorizenet\Form\Cc';
/**
* Info block type
+ *
+ * @var string
*/
protected $_infoBlockType = 'Magento\Authorizenet\Block\Authorizenet\Info\Cc';
- /**
+ /**#@+
* Availability options
+ *
+ * @var bool
*/
protected $_isGateway = true;
protected $_canAuthorize = true;
@@ -107,13 +115,17 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
protected $_canUseCheckout = true;
protected $_canSaveCc = false;
protected $_canFetchTransactionInfo = true;
+ /**#@-*/
+ /**
+ * @var string[]
+ */
protected $_allowCurrencyCode = array('USD');
/**
* Fields that should be replaced in debug with '***'
*
- * @var array
+ * @var string[]
*/
protected $_debugReplacePrivateDataKeys = array('x_login', 'x_tran_key',
'x_card_num', 'x_exp_date',
@@ -161,7 +173,7 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
/**
* Fields for creating place request checksum
*
- * @var array
+ * @var string[]
*/
protected $_partialAuthorizationChecksumDataKeys = array(
'x_version', 'x_test_request', 'x_login', 'x_test_request', 'x_allow_partial_auth', 'x_amount',
@@ -175,7 +187,7 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
/**
* Centinel cardinal fields map
*
- * @var array
+ * @var string[]
*/
protected $_centinelFieldMap = array(
'centinel_cavv' => 'x_cardholder_authentication_value',
@@ -188,7 +200,7 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
protected $_cardsStorage = null;
/**
- * Authorizenet data
+ * Authorize.net data
*
* @var \Magento\Authorizenet\Helper\Data
*/
@@ -288,7 +300,7 @@ public function __construct(
* Check method for processing with base currency
*
* @param string $currencyCode
- * @return boolean
+ * @return bool
*/
public function canUseForCurrency($currencyCode)
{
@@ -330,7 +342,7 @@ public function canCapture()
/**
* If there are not transactions it is placing order and capturing is available
*/
- foreach($this->getCardsStorage()->getCards() as $card) {
+ foreach ($this->getCardsStorage()->getCards() as $card) {
$lastTransaction = $this->getInfoInstance()->getTransaction($card->getLastTransId());
if ($lastTransaction) {
return false;
@@ -351,7 +363,7 @@ public function canRefund()
) {
return false;
}
- foreach($this->getCardsStorage()->getCards() as $card) {
+ foreach ($this->getCardsStorage()->getCards() as $card) {
$lastTransaction = $this->getInfoInstance()->getTransaction($card->getLastTransId());
if ($lastTransaction
&& $lastTransaction->getTxnType() == \Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE
@@ -366,7 +378,7 @@ public function canRefund()
/**
* Check void availability
*
- * @param \Magento\Object $invoicePayment
+ * @param \Magento\Object $payment
* @return bool
*/
public function canVoid(\Magento\Object $payment)
@@ -380,8 +392,8 @@ public function canVoid(\Magento\Object $payment)
/**
* Set partial authorization last action state into session
*
- * @param string $message
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @param string $state
+ * @return $this
*/
public function setPartialAuthorizationLastActionState($state)
{
@@ -402,7 +414,7 @@ public function getPartialAuthorizationLastActionState()
/**
* Unset partial authorization last action state in session
*
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @return $this
*/
public function unsetPartialAuthorizationLastActionState()
{
@@ -414,8 +426,9 @@ public function unsetPartialAuthorizationLastActionState()
* Send authorize request to gateway
*
* @param \Magento\Payment\Model\Info $payment
- * @param decimal $amount
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @param float $amount
+ * @return $this
+ * @throws \Magento\Core\Exception
*/
public function authorize(\Magento\Object $payment, $amount)
{
@@ -440,8 +453,9 @@ public function authorize(\Magento\Object $payment, $amount)
* Send capture request to gateway
*
* @param \Magento\Payment\Model\Info $payment
- * @param decimal $amount
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @param float $amount
+ * @return $this
+ * @throws \Magento\Core\Exception
*/
public function capture(\Magento\Object $payment, $amount)
{
@@ -464,7 +478,7 @@ public function capture(\Magento\Object $payment, $amount)
* Void the payment through gateway
*
* @param \Magento\Payment\Model\Info $payment
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @return $this
*/
public function void(\Magento\Object $payment)
{
@@ -473,7 +487,7 @@ public function void(\Magento\Object $payment)
$messages = array();
$isSuccessful = false;
$isFiled = false;
- foreach($cardsStorage->getCards() as $card) {
+ foreach ($cardsStorage->getCards() as $card) {
try {
$newTransaction = $this->_voidCardTransaction($payment, $card);
$messages[] = $newTransaction->getMessage();
@@ -498,7 +512,7 @@ public function void(\Magento\Object $payment)
* Cancel the payment through gateway
*
* @param \Magento\Payment\Model\Info $payment
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @return $this
*/
public function cancel(\Magento\Object $payment)
{
@@ -509,8 +523,8 @@ public function cancel(\Magento\Object $payment)
* Refund the amount with transaction id
*
* @param \Magento\Payment\Model\Info $payment
- * @param decimal $amount
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @param float $requestedAmount
+ * @return $this
* @throws \Magento\Core\Exception
*/
public function refund(\Magento\Object $payment, $requestedAmount)
@@ -527,7 +541,7 @@ public function refund(\Magento\Object $payment, $requestedAmount)
$messages = array();
$isSuccessful = false;
$isFiled = false;
- foreach($cardsStorage->getCards() as $card) {
+ foreach ($cardsStorage->getCards() as $card) {
if ($requestedAmount > 0) {
$cardAmountForRefund = $this->_formatAmount($card->getCapturedAmount() - $card->getRefundedAmount());
if ($cardAmountForRefund <= 0) {
@@ -566,8 +580,11 @@ public function refund(\Magento\Object $payment, $requestedAmount)
* Cancel partial authorizations and flush current split_tender_id record
*
* @param \Magento\Payment\Model\Info $payment
+ * @return void
+ * @throws \Magento\Core\Exception
*/
- public function cancelPartialAuthorization(\Magento\Payment\Model\Info $payment) {
+ public function cancelPartialAuthorization(\Magento\Payment\Model\Info $payment)
+ {
if (!$payment->getAdditionalInformation($this->_splitTenderIdKey)) {
throw new \Magento\Core\Exception(__('This is an invalid split tenderId ID.'));
}
@@ -597,9 +614,9 @@ public function cancelPartialAuthorization(\Magento\Payment\Model\Info $payment)
* Send request with new payment to gateway
*
* @param \Magento\Payment\Model\Info $payment
- * @param decimal $amount
+ * @param float $amount
* @param string $requestType
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @return $this
* @throws \Magento\Core\Exception
*/
protected function _place($payment, $amount, $requestType)
@@ -687,9 +704,11 @@ protected function _place($payment, $amount, $requestType)
* Send request with new payment to gateway during partial authorization process
*
* @param \Magento\Payment\Model\Info $payment
- * @param decimal $amount
+ * @param float $amount
* @param string $requestType
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @return $this
+ * @throws \Magento\Payment\Model\Info\Exception
+ * @throws \Magento\Core\Exception
*/
protected function _partialAuthorization($payment, $amount, $requestType)
{
@@ -764,7 +783,7 @@ protected function _isPreauthorizeCapture($payment)
if ($this->getCardsStorage()->getCardsCount() <= 0) {
return false;
}
- foreach($this->getCardsStorage()->getCards() as $card) {
+ foreach ($this->getCardsStorage()->getCards() as $card) {
$lastTransaction = $payment->getTransaction($card->getLastTransId());
if (!$lastTransaction
|| $lastTransaction->getTxnType() != \Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH
@@ -779,8 +798,9 @@ protected function _isPreauthorizeCapture($payment)
* Send capture request to gateway for capture authorized transactions
*
* @param \Magento\Payment\Model\Info $payment
- * @param decimal $amount
- * @return \Magento\Authorizenet\Model\Authorizenet
+ * @param float $requestedAmount
+ * @return $this
+ * @throws \Magento\Core\Exception
*/
protected function _preauthorizeCapture($payment, $requestedAmount)
{
@@ -796,15 +816,15 @@ protected function _preauthorizeCapture($payment, $requestedAmount)
$messages = array();
$isSuccessful = false;
$isFiled = false;
- foreach($cardsStorage->getCards() as $card) {
+ foreach ($cardsStorage->getCards() as $card) {
if ($requestedAmount > 0) {
$cardAmountForCapture = $card->getProcessedAmount();
if ($cardAmountForCapture > $requestedAmount) {
$cardAmountForCapture = $requestedAmount;
}
try {
$newTransaction = $this->_preauthorizeCaptureCardTransaction(
- $payment, $cardAmountForCapture , $card
+ $payment, $cardAmountForCapture, $card
);
$messages[] = $newTransaction->getMessage();
$isSuccessful = true;
@@ -890,6 +910,7 @@ protected function _preauthorizeCaptureCardTransaction($payment, $amount, $card)
* @param \Magento\Payment\Model\Info $payment
* @param \Magento\Object $card
* @return \Magento\Sales\Model\Order\Payment\Transaction
+ * @throws \Magento\Core\Exception
*/
protected function _voidCardTransaction($payment, $card)
{
@@ -984,9 +1005,10 @@ protected function _isTransactionExpired($realAuthTransactionId)
* Refund the card transaction through gateway
*
* @param \Magento\Payment\Model\Info $payment
- * @param $amount
+ * @param float $amount
* @param \Magento\Object $card
* @return \Magento\Sales\Model\Order\Payment\Transaction
+ * @throws \Magento\Core\Exception
*/
protected function _refundCardTransaction($payment, $amount, $card)
{
@@ -1055,6 +1077,7 @@ protected function _refundCardTransaction($payment, $amount, $card)
* Init cards storage model
*
* @param \Magento\Payment\Model\Info $payment
+ * @return void
*/
protected function _initCardsStorage($payment)
{
@@ -1079,7 +1102,7 @@ public function getCardsStorage($payment = null)
}
/**
- * If parial authorization is started method will returne true
+ * If partial authorization is started method will return true
*
* @param \Magento\Payment\Model\Info $payment
* @return bool
@@ -1097,7 +1120,7 @@ public function isPartialAuthorization($payment = null)
*
* @param \Magento\Sales\Model\Order\Invoice $invoice
* @param \Magento\Sales\Model\Order\Payment $payment
- * @return \Magento\Payment\Model\Method\AbstractMethod
+ * @return $this
*/
public function processInvoice($invoice, $payment)
{
@@ -1109,7 +1132,7 @@ public function processInvoice($invoice, $payment)
* Set transaction ID into creditmemo for informational purposes
* @param \Magento\Sales\Model\Order\Creditmemo $creditmemo
* @param \Magento\Sales\Model\Order\Payment $payment
- * @return \Magento\Payment\Model\Method\AbstractMethod
+ * @return $this
*/
public function processCreditmemo($creditmemo, $payment)
{
@@ -1152,10 +1175,10 @@ public function fetchTransactionInfo(\Magento\Payment\Model\Info $payment, $tran
}
/**
- * Set split_tender_id to quote payment if neeeded
+ * Set split_tender_id to quote payment if needed
*
* @param \Magento\Object $response
- * @param $orderPayment
+ * @param float $orderPayment
* @throws \Magento\Payment\Model\Info\Exception
* @return bool
*/
@@ -1237,9 +1260,9 @@ protected function _getRequest()
/**
* Prepare request to gateway
*
- * @link http://www.authorize.net/support/AIM_guide.pdf
* @param \Magento\Object|\Magento\Payment\Model\Info $payment
* @return \Magento\Authorizenet\Model\Authorizenet\Request
+ * @link http://www.authorize.net/support/AIM_guide.pdf
*/
protected function _buildRequest(\Magento\Object $payment)
{
@@ -1255,8 +1278,8 @@ protected function _buildRequest(\Magento\Object $payment)
$request->setXInvoiceNum($order->getIncrementId());
}
- if($payment->getAmount()){
- $request->setXAmount($payment->getAmount(),2);
+ if ($payment->getAmount()) {
+ $request->setXAmount($payment->getAmount(), 2);
$request->setXCurrencyCode($order->getBaseCurrencyCode());
}