Skip to content
Browse files

2.0.0.0-dev62

* Modularity improvements:
  * Moved all Grouped Product functionality to newly created module GroupedProduct
  * Moved Multishipping functionality to newly created module Multishipping
  * Extracted Product duplication behavior from Product model to Product\Copier model
  * Replaced event "catalog_model_product_duplicate" with composite Product\Copier model
  * Replaced event "catalog_product_prepare_save" with controller product initialization helper that can be customozed via plugins
  * Consolidated Authorize.Net functionality in single module Authorizenet
  * Eliminated dependency of Sales module on Shipping and Usa modules
  * Eliminated dependency of Shipping module on Customer module
  * Improved accuracy and quality of Module Dependency Test
* Fixed bugs:
  * Fixed an issue when order was sent to PayPal in USD regardless of currency used during order creation
  * Fixed an issue with 404 error when clicking any button on a Recurring Billing Profile in the backend
  * Fixed an issue with synchronization with Google Shopping on product update caused by missed service property
  * Fixed ability to submit order in the backend when Authorize.Net Direct Post is used
  * Fixed an issue with notice that _attribute_set column is missing during Import/Export
* Removed the deprecated service-calls and data source functionality
* Request\Response workflow improvements:
  * Added Console\Response
  * Changed behavior of AppInterface to return ResponseInterface instead of sending it
  • Loading branch information...
1 parent fa01f82 commit 8f72656ff34b751fae5227481de836f269f52270 @magento-team magento-team committed
Showing with 3,371 additions and 2,145 deletions.
  1. +27 −0 CHANGELOG.md
  2. +9 −0 app/code/Magento/AdminNotification/Block/Window.php
  3. +11 −11 app/code/Magento/{Paygate → Authorizenet}/Block/Authorizenet/Form/Cc.php
  4. +5 −5 app/code/Magento/{Paygate → Authorizenet}/Block/Authorizenet/Info/Cc.php
  5. +6 −6 app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php
  6. +6 −24 ...aygate/Controller/Adminhtml/Paygate → Authorizenet/Controller/Adminhtml}/Authorizenet/Payment.php
  7. +5 −27 app/code/Magento/{Paygate → Authorizenet}/Controller/Authorizenet/Payment.php
  8. +21 −2 app/code/Magento/Authorizenet/Controller/Directpost/Payment.php
  9. +30 −1 app/code/Magento/Authorizenet/Helper/Backend.php
  10. +156 −0 app/code/Magento/Authorizenet/Helper/Data.php
  11. +10 −2 app/code/Magento/Authorizenet/Helper/HelperInterface.php
  12. +55 −63 app/code/Magento/{Paygate → Authorizenet}/Model/Authorizenet.php
  13. +5 −5 app/code/Magento/{Paygate → Authorizenet}/Model/Authorizenet/Cards.php
  14. +12 −12 app/code/Magento/{Paygate → Authorizenet}/Model/Authorizenet/Debug.php
  15. +2 −2 app/code/Magento/{Paygate → Authorizenet}/Model/Authorizenet/Request.php
  16. +2 −2 app/code/Magento/{Paygate → Authorizenet}/Model/Authorizenet/Result.php
  17. +3 −3 app/code/Magento/{Paygate → Authorizenet}/Model/Authorizenet/Source/Cctype.php
  18. +4 −4 app/code/Magento/{Paygate → Authorizenet}/Model/Authorizenet/Source/PaymentAction.php
  19. +20 −13 app/code/Magento/Authorizenet/Model/Directpost.php
  20. +4 −4 app/code/Magento/Authorizenet/Model/Directpost/Observer.php
  21. +2 −2 app/code/Magento/Authorizenet/Model/Directpost/Request.php
  22. +4 −4 app/code/Magento/{Paygate → Authorizenet}/Model/Resource/Authorizenet/Debug.php
  23. +7 −4 app/code/Magento/{Paygate → Authorizenet}/Model/Resource/Authorizenet/Debug/Collection.php
  24. +5 −0 app/code/Magento/Authorizenet/etc/adminhtml/di.xml
  25. +108 −2 app/code/Magento/Authorizenet/etc/adminhtml/system.xml
  26. +18 −0 app/code/Magento/Authorizenet/etc/config.xml
  27. +12 −0 app/code/Magento/Authorizenet/etc/frontend/di.xml
  28. +1 −2 app/code/Magento/Authorizenet/etc/module.xml
  29. +60 −0 app/code/Magento/Authorizenet/i18n/de_DE.csv
  30. +46 −0 app/code/Magento/Authorizenet/i18n/en_US.csv
  31. +59 −0 app/code/Magento/Authorizenet/i18n/es_ES.csv
  32. +60 −0 app/code/Magento/Authorizenet/i18n/fr_FR.csv
  33. +61 −0 app/code/Magento/Authorizenet/i18n/nl_NL.csv
  34. +46 −0 app/code/Magento/Authorizenet/i18n/pt_BR.csv
  35. +46 −0 app/code/Magento/Authorizenet/i18n/zh_CN.csv
  36. 0 app/code/Magento/{Paygate → Authorizenet}/view/adminhtml/form/cc.phtml
  37. 0 app/code/Magento/{Paygate → Authorizenet}/view/adminhtml/info/cc.phtml
  38. 0 app/code/Magento/{Paygate → Authorizenet}/view/adminhtml/info/pdf.phtml
  39. +1 −1 .../view/frontend/paygate-authenticate.js → Authorizenet/view/frontend/authorizenet-authenticate.js}
  40. +2 −2 app/code/Magento/{Paygate → Authorizenet}/view/frontend/form/cc.phtml
  41. 0 app/code/Magento/{Paygate → Authorizenet}/view/frontend/info/cc.phtml
  42. +1 −2 ...roup.xml → Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml}
  43. +2 −0 app/code/Magento/Authz/etc/module.xml
  44. +3 −3 app/code/Magento/Backend/App/Response/Http/FileFactory.php
  45. +2 −2 app/code/Magento/Backend/Block/Template/Context.php
  46. +1 −1 app/code/Magento/Backend/Block/Widget/Grid/Export.php
  47. +1 −1 app/code/Magento/Backend/Block/Widget/Grid/Extended.php
  48. +86 −0 app/code/Magento/Backend/Block/Widget/Tab.php
  49. +1 −1 app/code/Magento/Backend/Controller/Adminhtml/System/Config.php
  50. +2 −1 app/code/Magento/Backend/Controller/Adminhtml/System/Store.php
  51. +3 −3 app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php
  52. +5 −5 app/code/Magento/Backend/Model/Config/Backend/File.php
  53. +2 −62 app/code/Magento/Backend/Model/Config/Structure/Element/Field.php
  54. +13 −0 app/code/Magento/Backend/etc/module.xml
  55. +0 −1 app/code/Magento/Backend/etc/system.xsd
  56. +0 −1 app/code/Magento/Backend/etc/system_file.xsd
  57. +3 −3 app/code/Magento/Backup/Controller/Adminhtml/Index.php
  58. +18 −18 app/code/Magento/Backup/Helper/Data.php
  59. +7 −7 app/code/Magento/Backup/Model/Backup.php
  60. +3 −3 app/code/Magento/Backup/Model/Fs/Collection.php
  61. +4 −4 app/code/Magento/Backup/Model/Observer.php
  62. +1 −0 app/code/Magento/Backup/etc/module.xml
  63. +5 −2 app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php
  64. +1 −0 app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php
  65. +74 −0 app/code/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php
  66. +0 −93 app/code/Magento/Bundle/Model/Observer.php
  67. +80 −0 app/code/Magento/Bundle/Model/Product/CopyConstructor/Bundle.php
  68. +2 −2 app/code/Magento/Bundle/Model/Product/Type.php
  69. +2 −2 app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php
  70. +2 −2 app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php
  71. +2 −2 app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php
  72. +10 −0 app/code/Magento/Bundle/etc/adminhtml/di.xml
  73. +0 −6 app/code/Magento/Bundle/etc/adminhtml/events.xml
  74. +2 −0 app/code/Magento/Bundle/etc/module.xml
  75. +1 −1 app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php
  76. +32 −30 app/code/Magento/Bundle/view/frontend/catalog/product/price.phtml
  77. +1 −1 ...iew/frontend/layout/{checkout_multishipping_addresses.xml → multishipping_checkout_addresses.xml}
  78. +1 −1 .../view/frontend/layout/{checkout_multishipping_overview.xml → multishipping_checkout_overview.xml}
  79. +2 −2 .../view/frontend/layout/{checkout_multishipping_shipping.xml → multishipping_checkout_shipping.xml}
  80. +2 −2 app/code/Magento/Captcha/Helper/Adminhtml/Data.php
  81. +6 −6 app/code/Magento/Captcha/Helper/Data.php
  82. +3 −3 app/code/Magento/Captcha/Model/Cron.php
  83. +0 −5 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php
  84. +13 −1 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php
  85. +1 −0 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php
  86. +7 −19 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php
  87. +0 −48 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs/Grouped.php
  88. +5 −4 app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php
  89. +3 −0 app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Weight.php
  90. +1 −0 app/code/Magento/Catalog/Block/Navigation.php
  91. +12 −11 app/code/Magento/Catalog/Block/Product/AbstractProduct.php
  92. +11 −9 app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php
  93. +1 −1 app/code/Magento/Catalog/Block/Product/Gallery.php
  94. +5 −2 app/code/Magento/Catalog/Block/Product/ListProduct.php
  95. +6 −2 app/code/Magento/Catalog/Block/Product/NewProduct.php
  96. +14 −0 app/code/Magento/Catalog/Block/Product/Price/Template.php
  97. +5 −2 app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php
  98. +5 −2 app/code/Magento/Catalog/Block/Product/ProductList/Random.php
  99. +6 −2 app/code/Magento/Catalog/Block/Product/ProductList/Related.php
  100. +1 −0 app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
  101. +6 −2 app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php
  102. +6 −2 app/code/Magento/Catalog/Block/Product/Send.php
  103. +25 −4 app/code/Magento/Catalog/Block/Product/View.php
  104. +5 −3 app/code/Magento/Catalog/Block/Product/View/AbstractView.php
  105. +32 −29 app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php
  106. +42 −192 app/code/Magento/Catalog/Controller/Adminhtml/Product.php
  107. +1 −1 app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php
  108. +145 −0 app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php
  109. +69 −0 app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php
  110. +73 −0 app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks.php
  111. +77 −0 app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilter.php
  112. +41 −25 app/code/Magento/Catalog/Helper/Product/Compare.php
  113. +2 −52 app/code/Magento/Catalog/Helper/Product/Configuration.php
  114. +3 −3 app/code/Magento/Catalog/Helper/Product/Options.php
  115. +152 −0 app/code/Magento/Catalog/Helper/Product/Price.php
  116. +4 −4 app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php
  117. +16 −179 app/code/Magento/Catalog/Model/Product.php
  118. +3 −3 app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php
  119. +81 −0 app/code/Magento/Catalog/Model/Product/Copier.php
  120. +60 −0 app/code/Magento/Catalog/Model/Product/CopyConstructor/Composite.php
  121. +52 −0 app/code/Magento/Catalog/Model/Product/CopyConstructor/CrossSell.php
  122. +53 −0 app/code/Magento/Catalog/Model/Product/CopyConstructor/Related.php
  123. +52 −0 app/code/Magento/Catalog/Model/Product/CopyConstructor/UpSell.php
  124. +18 −20 ...code/Magento/{Sales/Model/ResourceFactory.php → Catalog/Model/Product/CopyConstructorFactory.php}
  125. +8 −9 ...{Core/Model/DataService/ConfigInterface.php → Catalog/Model/Product/CopyConstructorInterface.php}
  126. +3 −3 app/code/Magento/Catalog/Model/Product/Image.php
  127. +0 −22 app/code/Magento/Catalog/Model/Product/Link.php
  128. +7 −7 app/code/Magento/Catalog/Model/Product/Option/Type/File.php
  129. +0 −1 app/code/Magento/Catalog/Model/Product/Type.php
  130. +6 −6 app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
  131. +2 −2 app/code/Magento/Catalog/Model/Product/Type/Configurable.php
  132. +12 −3 app/code/Magento/Catalog/Model/ProductTypes/Config.php
  133. +8 −0 app/code/Magento/Catalog/Model/ProductTypes/ConfigInterface.php
  134. +4 −4 app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Image.php
  135. +1 −44 app/code/Magento/Catalog/Model/Resource/Product/Link.php
  136. +3 −3 app/code/Magento/Catalog/Model/Resource/Setup.php
  137. +0 −14 app/code/Magento/Catalog/data/catalog_setup/data-install-1.6.0.0.php
  138. +17 −1 app/code/Magento/Catalog/etc/adminhtml/di.xml
  139. +2 −0 app/code/Magento/Catalog/etc/module.xml
  140. +0 −8 app/code/Magento/Catalog/etc/product_types.xml
  141. +0 −2 app/code/Magento/Catalog/i18n/de_DE.csv
  142. +0 −2 app/code/Magento/Catalog/i18n/en_US.csv
  143. +0 −2 app/code/Magento/Catalog/i18n/es_ES.csv
  144. +0 −2 app/code/Magento/Catalog/i18n/fr_FR.csv
  145. +0 −2 app/code/Magento/Catalog/i18n/nl_NL.csv
  146. +0 −2 app/code/Magento/Catalog/i18n/pt_BR.csv
  147. +0 −2 app/code/Magento/Catalog/i18n/zh_CN.csv
  148. +1 −1 app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php
  149. +1 −1 app/code/Magento/Catalog/sql/catalog_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php
  150. +19 −13 app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/config.phtml
  151. +34 −34 app/code/Magento/Catalog/view/adminhtml/catalog/product/price.phtml
  152. +33 −2 app/code/Magento/Catalog/view/adminhtml/catalog/type-switcher.js
  153. +16 −1 app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml
  154. +0 −23 app/code/Magento/Catalog/view/adminhtml/product/product.css
  155. +0 −1 app/code/Magento/Catalog/view/frontend/js/msrp.js
  156. +4 −3 app/code/Magento/Catalog/view/frontend/product/compare/list.phtml
  157. +14 −11 app/code/Magento/Catalog/view/frontend/product/compare/sidebar.phtml
  158. +23 −7 app/code/Magento/Catalog/view/frontend/product/list.phtml
  159. +24 −7 app/code/Magento/Catalog/view/frontend/product/list/items.phtml
  160. +2 −2 app/code/Magento/Catalog/view/frontend/product/listing.phtml
  161. +270 −321 app/code/Magento/Catalog/view/frontend/product/price.phtml
  162. +11 −9 app/code/Magento/Catalog/view/frontend/product/view/addto.phtml
  163. +4 −36 app/code/Magento/Catalog/view/frontend/product/view/addtocart.phtml
  164. +4 −7 app/code/Magento/Catalog/view/frontend/product/view/tierprices.phtml
  165. +10 −7 app/code/Magento/Catalog/view/frontend/product/view/validation.js
  166. +17 −2 app/code/Magento/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml
  167. +26 −11 app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_grid.phtml
  168. +25 −10 app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_list.phtml
  169. +14 −48 app/code/Magento/Catalog/view/frontend/rss/product/price.phtml
  170. +5 −2 app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php
  171. +1 −35 app/code/Magento/CatalogInventory/Model/Observer.php
  172. +56 −0 app/code/Magento/CatalogInventory/Model/Product/CopyConstructor/CatalogInventory.php
  173. +2 −1 app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php
  174. +7 −0 app/code/Magento/CatalogInventory/etc/adminhtml/di.xml
  175. +0 −3 app/code/Magento/CatalogInventory/etc/events.xml
  176. +1 −0 app/code/Magento/CatalogInventory/etc/module.xml
  177. +0 −3 app/code/Magento/CatalogInventory/etc/product_types.xml
  178. +7 −7 app/code/Magento/CatalogRule/Model/Observer.php
  179. +10 −10 app/code/Magento/CatalogRule/Model/Rule.php
  180. +5 −5 app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php
  181. +10 −10 app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Engine.php
  182. +1 −0 app/code/Magento/Centinel/Block/Authentication.php
  183. +1 −0 app/code/Magento/Centinel/etc/module.xml
  184. 0 .../view/frontend/layout/{checkout_multishipping_overview.xml → multishipping_checkout_overview.xml}
  185. +5 −5 app/code/Magento/Checkout/Block/Agreements.php
  186. +1 −0 app/code/Magento/Checkout/Block/Cart.php
  187. +1 −0 app/code/Magento/Checkout/Block/Cart/AbstractCart.php
  188. +18 −0 app/code/Magento/Checkout/Block/Cart/Coupon.php
  189. +7 −3 app/code/Magento/Checkout/Block/Cart/Crosssell.php
  190. +1 −0 app/code/Magento/Checkout/Block/Cart/Item/Renderer.php
  191. +30 −0 app/code/Magento/Checkout/Block/Cart/Item/Renderer/Configurable.php
  192. +30 −0 app/code/Magento/Checkout/Block/Cart/Item/Renderer/Grouped.php
  193. +11 −2 app/code/Magento/Checkout/Block/Cart/Shipping.php
  194. +1 −0 app/code/Magento/Checkout/Block/Cart/Sidebar.php
  195. +1 −0 app/code/Magento/Checkout/Block/Cart/Totals.php
  196. +32 −0 app/code/Magento/Checkout/Block/Onepage.php
  197. +11 −10 app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php
  198. +8 −7 app/code/Magento/Checkout/Block/Onepage/Billing.php
  199. +1 −0 app/code/Magento/Checkout/Block/Onepage/Failure.php
  200. +1 −0 app/code/Magento/Checkout/Block/Onepage/Link.php
  201. +7 −6 app/code/Magento/Checkout/Block/Onepage/Login.php
  202. +2 −1 app/code/Magento/Checkout/Block/Onepage/Payment/Info.php
  203. +1 −0 app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php
  204. +1 −0 app/code/Magento/Checkout/Block/Onepage/Review/Info.php
  205. +7 −6 app/code/Magento/Checkout/Block/Onepage/Shipping.php
  206. +7 −6 app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php
  207. +1 −0 app/code/Magento/Checkout/Block/Onepage/Success.php
  208. +1 −1 app/code/Magento/Checkout/Controller/Action.php
  209. +5 −5 app/code/Magento/Checkout/Helper/Data.php
  210. +0 −34 app/code/Magento/Checkout/Helper/Url.php
  211. +3 −3 app/code/Magento/Checkout/Model/Resource/Setup.php
  212. +0 −1 app/code/Magento/Checkout/etc/frontend/di.xml
  213. +0 −15 app/code/Magento/Checkout/etc/frontend/page_types.xml
  214. +5 −0 app/code/Magento/Checkout/etc/module.xml
  215. +0 −154 app/code/Magento/Checkout/sql/checkout_setup/install-1.6.0.0.php
  216. +3 −1 app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml
  217. +1 −1 app/code/Magento/Checkout/view/frontend/cart/item/default.phtml
  218. +0 −1 app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml
  219. +3 −3 app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php
  220. +3 −3 app/code/Magento/Cms/Helper/Wysiwyg/Images.php
Sorry, we could not display the entire diff because too many files (1,310) changed.
View
27 CHANGELOG.md
@@ -1,3 +1,26 @@
+2.0.0.0-dev62
+=============
+* Modularity improvements:
+ * Moved all Grouped Product functionality to newly created module GroupedProduct
+ * Moved Multishipping functionality to newly created module Multishipping
+ * Extracted Product duplication behavior from Product model to Product\Copier model
+ * Replaced event "catalog_model_product_duplicate" with composite Product\Copier model
+ * Replaced event "catalog_product_prepare_save" with controller product initialization helper that can be customozed via plugins
+ * Consolidated Authorize.Net functionality in single module Authorizenet
+ * Eliminated dependency of Sales module on Shipping and Usa modules
+ * Eliminated dependency of Shipping module on Customer module
+ * Improved accuracy and quality of Module Dependency Test
+* Fixed bugs:
+ * Fixed an issue when order was sent to PayPal in USD regardless of currency used during order creation
+ * Fixed an issue with 404 error when clicking any button on a Recurring Billing Profile in the backend
+ * Fixed an issue with synchronization with Google Shopping on product update caused by missed service property
+ * Fixed ability to submit order in the backend when Authorize.Net Direct Post is used
+ * Fixed an issue with notice that _attribute_set column is missing during Import/Export
+* Removed the deprecated service-calls and data source functionality
+* Request\Response workflow improvements:
+ * Added Console\Response
+ * Changed behavior of AppInterface to return ResponseInterface instead of sending it
+
2.0.0.0-dev61
=============
* Introduced a new layout block attribute - cacheable
@@ -147,6 +170,10 @@
* Fixed date resetting to 1 Jan 1970 after saving a design change in the admin panel in case date format is DD/MM/YY
* Fixed CAPTCHA on multi-address checkout flow
* Fixed view files population tool
+ * Fixed DHL functionality of generation shipping labels
+ * Fixed target rule if it is applied for specific customer segment
+ * Fixed product importing that cleared price and weight
+ * Fixed fatal error when a file reference is added to HTML head
* GitHub requests:
* [#122](https://github.com/magento/magento2/pull/122) -- Added support of federal units of Brazil with 27 states
* [#184](https://github.com/magento/magento2/issues/184) -- Removed unused blocks and methods in Magento_Wishlist module
View
9 app/code/Magento/AdminNotification/Block/Window.php
@@ -61,6 +61,14 @@ class Window extends \Magento\Backend\Block\Template
protected $_latestItem;
/**
+ * The property is used to define content-scope of block. Can be private or public.
+ * If it isn't defined then application considers it as false.
+ *
+ * @var bool
+ */
+ protected $_isScopePrivate;
+
+ /**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Backend\Model\Auth\Session $authSession
* @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection
@@ -75,6 +83,7 @@ public function __construct(
parent::__construct($context, $data);
$this->_authSession = $authSession;
$this->_criticalCollection = $criticalCollection;
+ $this->_isScopePrivate = true;
}
/**
View
22 ...to/Paygate/Block/Authorizenet/Form/Cc.php → ...thorizenet/Block/Authorizenet/Form/Cc.php
@@ -19,16 +19,16 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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\Paygate\Block\Authorizenet\Form;
+namespace Magento\Authorizenet\Block\Authorizenet\Form;
class Cc extends \Magento\Payment\Block\Form
{
- protected $_template = 'Magento_Paygate::form/cc.phtml';
+ protected $_template = 'Magento_Authorizenet::form/cc.phtml';
/**
* Retrieve payment method form html
@@ -48,7 +48,7 @@ public function getMethodFormBlock()
*/
public function getCardsBlock()
{
- return $this->getLayout()->createBlock('Magento\Paygate\Block\Authorizenet\Info\Cc')
+ return $this->getLayout()->createBlock('Magento\Authorizenet\Block\Authorizenet\Info\Cc')
->setMethod($this->getMethod())
->setInfo($this->getMethod()->getInfoInstance())
->setCheckoutProgressBlock(false)
@@ -62,7 +62,7 @@ public function getCardsBlock()
*/
public function getCancelUrl()
{
- return $this->getUrl('paygate/authorizenet_payment/cancel');
+ return $this->getUrl('authorizenet/authorizenet_payment/cancel');
}
/**
@@ -72,7 +72,7 @@ public function getCancelUrl()
*/
public function getAdminCancelUrl()
{
- return $this->_urlBuilder->getUrl('adminhtml/paygate_authorizenet_payment/cancel');
+ return $this->_urlBuilder->getUrl('adminhtml/authorizenet_payment/cancel');
}
/**
@@ -107,10 +107,10 @@ public function showNoticeMessage($message)
public function getPartialAuthorizationConfirmationMessage()
{
$lastActionState = $this->getMethod()->getPartialAuthorizationLastActionState();
- if ($lastActionState == \Magento\Paygate\Model\Authorizenet::PARTIAL_AUTH_LAST_SUCCESS) {
+ if ($lastActionState == \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_LAST_SUCCESS) {
$this->getMethod()->unsetPartialAuthorizationLastActionState();
return __('You don\'t have enough on your credit card to pay for this purchase. To complete your purchase, click "OK" and add a credit card to use for the balance. Otherwise, you can cancel the purchase and release the partial payment we are holding.');
- } elseif ($lastActionState == \Magento\Paygate\Model\Authorizenet::PARTIAL_AUTH_LAST_DECLINED) {
+ } elseif ($lastActionState == \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_LAST_DECLINED) {
$this->getMethod()->unsetPartialAuthorizationLastActionState();
return __('Your credit card has been declined. You can click OK to add another credit card to complete your purchase. Or you can cancel this credit transaction and pay a different way.');
}
@@ -127,13 +127,13 @@ public function getPartialAuthorizationFormMessage()
$lastActionState = $this->getMethod()->getPartialAuthorizationLastActionState();
$message = false;
switch ($lastActionState) {
- case \Magento\Paygate\Model\Authorizenet::PARTIAL_AUTH_ALL_CANCELED:
+ case \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_ALL_CANCELED:
$message = __('We canceled your payment and released any money we were holding.');
break;
- case \Magento\Paygate\Model\Authorizenet::PARTIAL_AUTH_CARDS_LIMIT_EXCEEDED:
+ case \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_CARDS_LIMIT_EXCEEDED:
$message = __('You can\'t use any more credit cards for this payment, and you don\'t have enough to pay for this purchase. Sorry, but we\'ll have to cancel your transaction.');
break;
- case \Magento\Paygate\Model\Authorizenet::PARTIAL_AUTH_DATA_CHANGED:
+ case \Magento\Authorizenet\Model\Authorizenet::PARTIAL_AUTH_DATA_CHANGED:
$message = __('Your order has not been placed, because the contents of the shopping cart and/or your address has been changed. Authorized amounts from your previous payment that were left pending are now released. Please go through the checkout process to purchase your cart contents.');
break;
}
View
10 ...to/Paygate/Block/Authorizenet/Info/Cc.php → ...thorizenet/Block/Authorizenet/Info/Cc.php
@@ -19,12 +19,12 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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\Paygate\Block\Authorizenet\Info;
+namespace Magento\Authorizenet\Block\Authorizenet\Info;
use Magento\Payment\Block\Info;
@@ -37,7 +37,7 @@ class Cc extends \Magento\Payment\Block\Info\Cc
*/
protected $_isCheckoutProgressBlockFlag = true;
- protected $_template = 'Magento_Paygate::info/cc.phtml';
+ protected $_template = 'Magento_Authorizenet::info/cc.phtml';
/**
* @var \Magento\Core\Helper\Data
@@ -67,7 +67,7 @@ public function __construct(
*/
public function toPdf()
{
- $this->setTemplate('Magento_Paygate::info/pdf.phtml');
+ $this->setTemplate('Magento_Authorizenet::info/pdf.phtml');
return $this->toHtml();
}
@@ -90,7 +90,7 @@ public function getInfo()
* in Previously used card information block
*
* @param bool $flag
- * @return \Magento\Paygate\Block\Authorizenet\Info\Cc
+ * @return \Magento\Authorizenet\Block\Authorizenet\Info\Cc
*/
public function setCheckoutProgressBlock($flag)
{
View
12 app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php
@@ -130,18 +130,18 @@ public function placeAction()
$session->addCheckoutOrderIncrementId($order->getIncrementId());
$session->setLastOrderIncrementId($order->getIncrementId());
- $requestToPaygate = $payment->getMethodInstance()->generateRequestFromOrder($order);
- $requestToPaygate->setControllerActionName($controller);
- $requestToPaygate->setOrderSendConfirmation($sendConfirmationFlag);
- $requestToPaygate->setStoreId($this->_getOrderCreateModel()->getQuote()->getStoreId());
+ $requestToAuthorizenet = $payment->getMethodInstance()->generateRequestFromOrder($order);
+ $requestToAuthorizenet->setControllerActionName($controller);
+ $requestToAuthorizenet->setOrderSendConfirmation($sendConfirmationFlag);
+ $requestToAuthorizenet->setStoreId($this->_getOrderCreateModel()->getQuote()->getStoreId());
$adminUrl = $this->_objectManager->get('Magento\Backend\Model\Url');
if ($adminUrl->useSecretKey()) {
- $requestToPaygate->setKey(
+ $requestToAuthorizenet->setKey(
$adminUrl->getSecretKey('adminhtml', 'authorizenet_directpost_payment', 'redirect')
);
}
- $result['directpost'] = array('fields' => $requestToPaygate->getData());
+ $result['directpost'] = array('fields' => $requestToAuthorizenet->getData());
}
$result['success'] = 1;
View
30 ...dminhtml/Paygate/Authorizenet/Payment.php → ...roller/Adminhtml/Authorizenet/Payment.php
@@ -19,7 +19,7 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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)
*/
@@ -28,10 +28,10 @@
* Authorize Payment Controller
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\Paygate\Controller\Adminhtml\Paygate\Authorizenet;
+namespace Magento\Authorizenet\Controller\Adminhtml\Authorizenet;
class Payment extends \Magento\Backend\App\Action
{
@@ -63,7 +63,7 @@ public function cancelAction()
$result['success'] = false;
try {
$paymentMethod = $this->_objectManager->get('Magento\Payment\Helper\Data')
- ->getMethodInstance(\Magento\Paygate\Model\Authorizenet::METHOD_CODE);
+ ->getMethodInstance(\Magento\Authorizenet\Model\Authorizenet::METHOD_CODE);
if ($paymentMethod) {
$paymentMethod->setStore(
@@ -75,7 +75,8 @@ public function cancelAction()
}
$result['success'] = true;
- $result['update_html'] = $this->_getPaymentMethodsHtml();
+ $result['update_html'] = $this->_objectManager->get('Magento\Authorizenet\Helper\Data')
+ ->getPaymentMethodsHtml($this->_view);
} catch (\Magento\Core\Exception $e) {
$this->_objectManager->get('Magento\Logger')->logException($e);
$result['error_message'] = $e->getMessage();
@@ -87,23 +88,4 @@ public function cancelAction()
$this->_sessionQuote->getQuote()->getPayment()->save();
$this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result));
}
-
- /**
- * Get payment method step html
- *
- * @return string
- */
- protected function _getPaymentMethodsHtml()
- {
- $layout = $this->_view->getLayout();
-
- $update = $layout->getUpdate();
- $update->load('checkout_onepage_paymentmethod');
-
- $layout->generateXml();
- $layout->generateElements();
-
- $output = $layout->getOutput();
- return $output;
- }
}
View
32 ...ygate/Controller/Authorizenet/Payment.php → ...zenet/Controller/Authorizenet/Payment.php
@@ -19,19 +19,12 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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)
*/
-/**
- * Authorize Payment Controller
- *
- * @category Magento
- * @package Magento_Paygate
- * @author Magento Core Team <core@magentocommerce.com>
- */
-namespace Magento\Paygate\Controller\Authorizenet;
+namespace Magento\Authorizenet\Controller\Authorizenet;
class Payment extends \Magento\App\Action\Action
{
@@ -63,14 +56,15 @@ public function cancelAction()
$result['success'] = false;
try {
$paymentMethod = $this->_objectManager->get('Magento\Payment\Helper\Data')
- ->getMethodInstance(\Magento\Paygate\Model\Authorizenet::METHOD_CODE);
+ ->getMethodInstance(\Magento\Authorizenet\Model\Authorizenet::METHOD_CODE);
if ($paymentMethod) {
$paymentMethod->cancelPartialAuthorization(
$this->_session->getQuote()->getPayment()
);
}
$result['success'] = true;
- $result['update_html'] = $this->_getPaymentMethodsHtml();
+ $result['update_html'] = $this->_objectManager->get('Magento\Authorizenet\Helper\Data')
+ ->getPaymentMethodsHtml($this->_view);
} catch (\Magento\Core\Exception $e) {
$this->_objectManager->get('Magento\Logger')->logException($e);
$result['error_message'] = $e->getMessage();
@@ -82,20 +76,4 @@ public function cancelAction()
$this->_session->getQuote()->getPayment()->save();
$this->getResponse()->setBody($this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result));
}
-
- /**
- * Get payment method step html
- *
- * @return string
- */
- protected function _getPaymentMethodsHtml()
- {
- $layout = $this->_view->getLayout();
- $update = $layout->getUpdate();
- $update->load('checkout_onepage_paymentmethod');
- $layout->generateXml();
- $layout->generateElements();
- $output = $layout->getOutput();
- return $output;
- }
}
View
23 app/code/Magento/Authorizenet/Controller/Directpost/Payment.php
@@ -76,8 +76,28 @@ protected function _getDirectPostSession()
* Response action.
* Action for Authorize.net SIM Relay Request.
*/
+ public function backendResponseAction()
+ {
+ $this->_responseAction($this->_objectManager->get('Magento\Authorizenet\Helper\Backend'));
+ }
+
+ /**
+ * Response action.
+ * Action for Authorize.net SIM Relay Request.
+ */
public function responseAction()
{
+ $this->_responseAction($this->_objectManager->get('Magento\Authorizenet\Helper\Data'));
+ }
+
+ /**
+ * Response action.
+ * Action for Authorize.net SIM Relay Request.
+ *
+ * @param \Magento\Authorizenet\Helper\HelperInterface $helper
+ */
+ protected function _responseAction(\Magento\Authorizenet\Helper\HelperInterface $helper)
+ {
$params = array();
$data = $this->getRequest()->getPost();
/* @var $paymentMethod \Magento\Authorizenet\Model\DirectPost */
@@ -112,8 +132,7 @@ public function responseAction()
}
$result['controller_action_name'] = $data['controller_action_name'];
$result['is_secure'] = isset($data['is_secure']) ? $data['is_secure'] : false;
- $params['redirect'] = $this->_objectManager->get('Magento\Authorizenet\Helper\HelperInterface')
- ->getRedirectIframeUrl($result);
+ $params['redirect'] = $helper->getRedirectIframeUrl($result);
}
$this->_coreRegistry->register('authorizenet_directpost_form_params', $params);
View
31 app/code/Magento/Authorizenet/Helper/Backend.php
@@ -32,6 +32,23 @@
class Backend extends Data
{
/**
+ * @param \Magento\App\Helper\Context $context
+ * @param \Magento\Core\Model\StoreManagerInterface $storeManager
+ * @param \Magento\Sales\Model\OrderFactory $orderFactory
+ * @param \Magento\Backend\Model\Url $backendUrl
+ */
+ public function __construct(
+ \Magento\App\Helper\Context $context,
+ \Magento\Core\Model\StoreManagerInterface $storeManager,
+ \Magento\Sales\Model\OrderFactory $orderFactory,
+ \Magento\Backend\Model\Url $backendUrl
+ ) {
+ parent::__construct($context, $storeManager, $orderFactory);
+ $this->_urlBuilder = $backendUrl;
+ }
+
+
+ /**
* Return URL for admin area
*
* @param string $route
@@ -50,7 +67,7 @@ protected function _getUrl($route, $params = array())
*/
public function getPlaceOrderAdminUrl()
{
- return $this->_getUrl('*/authorizenet_directpost_payment/place', array());
+ return $this->_getUrl('adminhtml/authorizenet_directpost_payment/place', array());
}
/**
@@ -78,4 +95,16 @@ public function getRedirectIframeUrl($params)
{
return $this->_getUrl('adminhtml/authorizenet_directpost_payment/redirect', $params);
}
+
+ /**
+ * Get direct post rely url
+ *
+ * @param null|int|string $storeId
+ * @return string
+ */
+ public function getRelyUrl($storeId = null)
+ {
+ return $this->_storeManager->getDefaultStoreView()->getBaseUrl(\Magento\Core\Model\Store::URL_TYPE_LINK)
+ . 'authorizenet/directpost_payment/backendResponse';
+ }
}
View
156 app/code/Magento/Authorizenet/Helper/Data.php
@@ -178,4 +178,160 @@ public function updateOrderEditIncrements(\Magento\Sales\Model\Order $order)
}
}
}
+
+ /**
+ * Converts a lot of messages to message
+ *
+ * @param array $messages
+ * @return string
+ */
+ public function convertMessagesToMessage($messages)
+ {
+ return implode(' | ', $messages);
+ }
+
+ /**
+ * Return message for gateway transaction request
+ *
+ * @param \Magento\Payment\Model\Info $payment
+ * @param string $requestType
+ * @param string $lastTransactionId
+ * @param \Magento\Object $card
+ * @param bool|float $amount
+ * @param bool|string $exception
+ * @return bool|string
+ */
+ public function getTransactionMessage(
+ $payment,
+ $requestType,
+ $lastTransactionId,
+ $card,
+ $amount = false,
+ $exception = false
+ ) {
+ return $this->getExtendedTransactionMessage(
+ $payment, $requestType, $lastTransactionId, $card, $amount, $exception
+ );
+ }
+
+ /**
+ * Return message for gateway transaction request
+ *
+ * @param \Magento\Payment\Model\Info $payment
+ * @param string $requestType
+ * @param string $lastTransactionId
+ * @param \Magento\Object $card
+ * @param bool|float $amount
+ * @param bool|string $exception
+ * @param bool|string $additionalMessage
+ * @return bool|mixed
+ */
+ public function getExtendedTransactionMessage(
+ $payment,
+ $requestType,
+ $lastTransactionId,
+ $card,
+ $amount = false,
+ $exception = false,
+ $additionalMessage = false
+ ) {
+ $operation = $this->_getOperation($requestType);
+
+ if (!$operation) {
+ return false;
+ }
+
+ if ($amount) {
+ $amount = __('amount %1', $this->_formatPrice($payment, $amount));
+ }
+
+ if ($exception) {
+ $result = __('failed');
+ } else {
+ $result = __('successful');
+ }
+
+ $card = __('Credit Card: xxxx-%1', $card->getCcLast4());
+
+ $pattern = '%s %s %s - %s.';
+ $texts = array($card, $amount, $operation, $result);
+
+ if (!is_null($lastTransactionId)) {
+ $pattern .= ' %s.';
+ $texts[] = __('Authorize.Net Transaction ID %1', $lastTransactionId);
+ }
+
+ if ($additionalMessage) {
+ $pattern .= ' %s.';
+ $texts[] = $additionalMessage;
+ }
+ $pattern .= ' %s';
+ $texts[] = $exception;
+
+ return call_user_func_array('__', array_merge(array($pattern), $texts));
+ }
+
+ /**
+ * Return operation name for request type
+ *
+ * @param string $requestType
+ * @return bool|string
+ */
+ protected function _getOperation($requestType)
+ {
+ switch ($requestType) {
+ case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_AUTH_ONLY:
+ return __('authorize');
+ case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_AUTH_CAPTURE:
+ return __('authorize and capture');
+ case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_PRIOR_AUTH_CAPTURE:
+ return __('capture');
+ case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_CREDIT:
+ return __('refund');
+ case \Magento\Authorizenet\Model\Authorizenet::REQUEST_TYPE_VOID:
+ return __('void');
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Format price with currency sign
+ * @param \Magento\Payment\Model\Info $payment
+ * @param float $amount
+ * @return string
+ */
+ protected function _formatPrice($payment, $amount)
+ {
+ return $payment->getOrder()->getBaseCurrency()->formatTxt($amount);
+ }
+
+ /**
+ * Get payment method step html
+ *
+ * @param \Magento\App\ViewInterface $view
+ * @return string
+ */
+ public function getPaymentMethodsHtml(\Magento\App\ViewInterface $view)
+ {
+ $layout = $view->getLayout();
+ $update = $layout->getUpdate();
+ $update->load('checkout_onepage_paymentmethod');
+ $layout->generateXml();
+ $layout->generateElements();
+ $output = $layout->getOutput();
+ return $output;
+ }
+
+ /**
+ * Get direct post rely url
+ *
+ * @param null|int|string $storeId
+ * @return string
+ */
+ public function getRelyUrl($storeId = null)
+ {
+ return $this->_storeManager->getStore($storeId)->getBaseUrl(\Magento\Core\Model\Store::URL_TYPE_LINK)
+ . 'authorizenet/directpost_payment/response';
+ }
}
View
12 app/code/Magento/Authorizenet/Helper/HelperInterface.php
@@ -34,7 +34,7 @@
/**
* Retrieve place order url
*
- * @param array params
+ * @param array $params
* @return string
*/
public function getSuccessOrderUrl($params);
@@ -42,8 +42,16 @@ public function getSuccessOrderUrl($params);
/**
* Retrieve redirect ifrmae url
*
- * @param array params
+ * @param array $params
* @return string
*/
public function getRedirectIframeUrl($params);
+
+ /**
+ * Get direct post rely url
+ *
+ * @param null|int|string $storeId
+ * @return string
+ */
+ public function getRelyUrl($storeId = null);
}
View
118 ...de/Magento/Paygate/Model/Authorizenet.php → ...gento/Authorizenet/Model/Authorizenet.php
@@ -22,7 +22,7 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-namespace Magento\Paygate\Model;
+namespace Magento\Authorizenet\Model;
class Authorizenet extends \Magento\Payment\Model\Method\Cc
{
@@ -86,12 +86,12 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
/**
* Form block type
*/
- protected $_formBlockType = 'Magento\Paygate\Block\Authorizenet\Form\Cc';
+ protected $_formBlockType = 'Magento\Authorizenet\Block\Authorizenet\Form\Cc';
/**
* Info block type
*/
- protected $_infoBlockType = 'Magento\Paygate\Block\Authorizenet\Info\Cc';
+ protected $_infoBlockType = 'Magento\Authorizenet\Block\Authorizenet\Info\Cc';
/**
* Availability options
@@ -151,13 +151,13 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
* Key for storing partial authorization last action state in session
* @var string
*/
- protected $_partialAuthorizationLastActionStateSessionKey = 'paygate_authorizenet_last_action_state';
+ protected $_partialAuthorizationLastActionStateSessionKey = 'authorizenet_last_action_state';
/**
* Key for storing partial authorization checksum in session
* @var string
*/
- protected $_partialAuthorizationChecksumSessionKey = 'paygate_authorizenet_checksum';
+ protected $_partialAuthorizationChecksumSessionKey = 'authorizenet_checksum';
/**
* Fields for creating place request checksum
@@ -184,16 +184,16 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
);
/**
- * @var \Magento\Paygate\Model\Authorizenet\Cards
+ * @var \Magento\Authorizenet\Model\Authorizenet\Cards
*/
protected $_cardsStorage = null;
/**
- * Paygate data
+ * Authorizenet data
*
- * @var \Magento\Paygate\Helper\Data
+ * @var \Magento\Authorizenet\Helper\Data
*/
- protected $_paygateData = null;
+ protected $_authorizenetData = null;
/**
* Session
@@ -212,21 +212,21 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
/**
* Result factory
*
- * @var \Magento\Paygate\Model\Authorizenet\ResultFactory
+ * @var \Magento\Authorizenet\Model\Authorizenet\ResultFactory
*/
protected $_resultFactory;
/**
* Request factory
*
- * @var \Magento\Paygate\Model\Authorizenet\RequestFactory
+ * @var \Magento\Authorizenet\Model\Authorizenet\RequestFactory
*/
protected $_requestFactory;
/**
* Cards factory
*
- * @var \Magento\Paygate\Model\Authorizenet\CardsFactory
+ * @var \Magento\Authorizenet\Model\Authorizenet\CardsFactory
*/
protected $_cardsFactory;
@@ -239,12 +239,12 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc
* @param \Magento\Module\ModuleListInterface $moduleList
* @param \Magento\Core\Model\LocaleInterface $locale
* @param \Magento\Centinel\Model\Service $centinelService
- * @param \Magento\Paygate\Model\Authorizenet\CardsFactory $cardsFactory
- * @param \Magento\Paygate\Model\Authorizenet\RequestFactory $requestFactory
- * @param \Magento\Paygate\Model\Authorizenet\ResultFactory $resultFactory
+ * @param \Magento\Authorizenet\Model\Authorizenet\CardsFactory $cardsFactory
+ * @param \Magento\Authorizenet\Model\Authorizenet\RequestFactory $requestFactory
+ * @param \Magento\Authorizenet\Model\Authorizenet\ResultFactory $resultFactory
* @param \Magento\Sales\Model\OrderFactory $orderFactory
* @param \Magento\Session\SessionManagerInterface $session
- * @param \Magento\Paygate\Helper\Data $paygateData
+ * @param \Magento\Authorizenet\Helper\Data $authorizenetData
* @param array $data
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -258,12 +258,12 @@ public function __construct(
\Magento\Module\ModuleListInterface $moduleList,
\Magento\Core\Model\LocaleInterface $locale,
\Magento\Centinel\Model\Service $centinelService,
- \Magento\Paygate\Model\Authorizenet\CardsFactory $cardsFactory,
- \Magento\Paygate\Model\Authorizenet\RequestFactory $requestFactory,
- \Magento\Paygate\Model\Authorizenet\ResultFactory $resultFactory,
+ \Magento\Authorizenet\Model\Authorizenet\CardsFactory $cardsFactory,
+ \Magento\Authorizenet\Model\Authorizenet\RequestFactory $requestFactory,
+ \Magento\Authorizenet\Model\Authorizenet\ResultFactory $resultFactory,
\Magento\Sales\Model\OrderFactory $orderFactory,
\Magento\Session\SessionManagerInterface $session,
- \Magento\Paygate\Helper\Data $paygateData,
+ \Magento\Authorizenet\Helper\Data $authorizenetData,
array $data = array()
) {
$this->_cardsFactory = $cardsFactory;
@@ -271,7 +271,7 @@ public function __construct(
$this->_resultFactory = $resultFactory;
$this->_orderFactory = $orderFactory;
$this->_session = $session;
- $this->_paygateData = $paygateData;
+ $this->_authorizenetData = $authorizenetData;
parent::__construct(
$eventManager,
$paymentData,
@@ -382,7 +382,7 @@ public function canVoid(\Magento\Object $payment)
* Set partial authorization last action state into session
*
* @param string $message
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
*/
public function setPartialAuthorizationLastActionState($state)
{
@@ -403,7 +403,7 @@ public function getPartialAuthorizationLastActionState()
/**
* Unset partial authorization last action state in session
*
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
*/
public function unsetPartialAuthorizationLastActionState()
{
@@ -416,7 +416,7 @@ public function unsetPartialAuthorizationLastActionState()
*
* @param \Magento\Payment\Model\Info $payment
* @param decimal $amount
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
*/
public function authorize(\Magento\Object $payment, $amount)
{
@@ -442,7 +442,7 @@ public function authorize(\Magento\Object $payment, $amount)
*
* @param \Magento\Payment\Model\Info $payment
* @param decimal $amount
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
*/
public function capture(\Magento\Object $payment, $amount)
{
@@ -465,7 +465,7 @@ public function capture(\Magento\Object $payment, $amount)
* Void the payment through gateway
*
* @param \Magento\Payment\Model\Info $payment
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
*/
public function void(\Magento\Object $payment)
{
@@ -499,7 +499,7 @@ public function void(\Magento\Object $payment)
* Cancel the payment through gateway
*
* @param \Magento\Payment\Model\Info $payment
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
*/
public function cancel(\Magento\Object $payment)
{
@@ -511,7 +511,7 @@ public function cancel(\Magento\Object $payment)
*
* @param \Magento\Payment\Model\Info $payment
* @param decimal $amount
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
* @throws \Magento\Core\Exception
*/
public function refund(\Magento\Object $payment, $requestedAmount)
@@ -600,7 +600,7 @@ public function cancelPartialAuthorization(\Magento\Payment\Model\Info $payment)
* @param \Magento\Payment\Model\Info $payment
* @param decimal $amount
* @param string $requestType
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
* @throws \Magento\Core\Exception
*/
protected function _place($payment, $amount, $requestType)
@@ -631,7 +631,7 @@ protected function _place($payment, $amount, $requestType)
$newTransactionType,
array('is_transaction_closed' => 0),
array($this->_realTransactionIdKey => $card->getLastTransId()),
- $this->_paygateData->getTransactionMessage(
+ $this->_authorizenetData->getTransactionMessage(
$payment, $requestType, $card->getLastTransId(), $card, $amount
)
);
@@ -654,7 +654,7 @@ protected function _place($payment, $amount, $requestType)
$this->_realTransactionIdKey => $card->getLastTransId(),
$this->_isTransactionFraud => true
),
- $this->_paygateData->getTransactionMessage(
+ $this->_authorizenetData->getTransactionMessage(
$payment, $requestType, $card->getLastTransId(), $card, $amount
)
);
@@ -690,7 +690,7 @@ protected function _place($payment, $amount, $requestType)
* @param \Magento\Payment\Model\Info $payment
* @param decimal $amount
* @param string $requestType
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
*/
protected function _partialAuthorization($payment, $amount, $requestType)
{
@@ -741,7 +741,7 @@ protected function _partialAuthorization($payment, $amount, $requestType)
$newTransactionType,
array('is_transaction_closed' => 0),
array($this->_realTransactionIdKey => $card->getLastTransId()),
- $this->_paygateData->getTransactionMessage(
+ $this->_authorizenetData->getTransactionMessage(
$payment, $requestType, $card->getLastTransId(), $card, $card->getProcessedAmount()
)
);
@@ -781,7 +781,7 @@ protected function _isPreauthorizeCapture($payment)
*
* @param \Magento\Payment\Model\Info $payment
* @param decimal $amount
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
*/
protected function _preauthorizeCapture($payment, $requestedAmount)
{
@@ -817,11 +817,6 @@ protected function _preauthorizeCapture($payment, $requestedAmount)
$card->setCapturedAmount($cardAmountForCapture);
$cardsStorage->updateCard($card);
$requestedAmount = $this->_formatAmount($requestedAmount - $cardAmountForCapture);
- } else {
- /**
- * This functional is commented because partial capture is disable. See self::_canCapturePartial.
- */
- //$this->_voidCardTransaction($payment, $card);
}
}
@@ -835,9 +830,10 @@ protected function _preauthorizeCapture($payment, $requestedAmount)
* Send capture request to gateway for capture authorized transactions of card
*
* @param \Magento\Payment\Model\Info $payment
- * @param decimal $amount
+ * @param float $amount
* @param \Magento\Object $card
* @return \Magento\Sales\Model\Order\Payment\Transaction
+ * @throws \Magento\Core\Exception
*/
protected function _preauthorizeCaptureCardTransaction($payment, $amount, $card)
{
@@ -866,7 +862,7 @@ protected function _preauthorizeCaptureCardTransaction($payment, $amount, $card)
'parent_transaction_id' => $authTransactionId
),
array($this->_realTransactionIdKey => $result->getTransactionId()),
- $this->_paygateData->getTransactionMessage(
+ $this->_authorizenetData->getTransactionMessage(
$payment, self::REQUEST_TYPE_PRIOR_AUTH_CAPTURE, $result->getTransactionId(), $card, $amount
)
);
@@ -883,7 +879,7 @@ protected function _preauthorizeCaptureCardTransaction($payment, $amount, $card)
break;
}
- $exceptionMessage = $this->_paygateData->getTransactionMessage(
+ $exceptionMessage = $this->_authorizenetData->getTransactionMessage(
$payment, self::REQUEST_TYPE_PRIOR_AUTH_CAPTURE, $realAuthTransactionId, $card, $amount, $exceptionMessage
);
throw new \Magento\Core\Exception($exceptionMessage);
@@ -923,7 +919,7 @@ protected function _voidCardTransaction($payment, $card)
'parent_transaction_id' => $authTransactionId
),
array($this->_realTransactionIdKey => $result->getTransactionId()),
- $this->_paygateData->getTransactionMessage(
+ $this->_authorizenetData->getTransactionMessage(
$payment, self::REQUEST_TYPE_VOID, $result->getTransactionId(), $card
)
);
@@ -946,7 +942,7 @@ protected function _voidCardTransaction($payment, $card)
'parent_transaction_id' => $authTransactionId
),
array(),
- $this->_paygateData->getExtendedTransactionMessage(
+ $this->_authorizenetData->getExtendedTransactionMessage(
$payment,
self::REQUEST_TYPE_VOID,
null,
@@ -967,7 +963,7 @@ protected function _voidCardTransaction($payment, $card)
break;
}
- $exceptionMessage = $this->_paygateData->getTransactionMessage(
+ $exceptionMessage = $this->_authorizenetData->getTransactionMessage(
$payment, self::REQUEST_TYPE_VOID, $realAuthTransactionId, $card, false, $exceptionMessage
);
throw new \Magento\Core\Exception($exceptionMessage);
@@ -1034,7 +1030,7 @@ protected function _refundCardTransaction($payment, $amount, $card)
'parent_transaction_id' => $captureTransactionId
),
array($this->_realTransactionIdKey => $result->getTransactionId()),
- $this->_paygateData->getTransactionMessage(
+ $this->_authorizenetData->getTransactionMessage(
$payment, self::REQUEST_TYPE_CREDIT, $result->getTransactionId(), $card, $amount
)
);
@@ -1050,7 +1046,7 @@ protected function _refundCardTransaction($payment, $amount, $card)
break;
}
- $exceptionMessage = $this->_paygateData->getTransactionMessage(
+ $exceptionMessage = $this->_authorizenetData->getTransactionMessage(
$payment, self::REQUEST_TYPE_CREDIT, $realCaptureTransactionId, $card, $amount, $exceptionMessage
);
throw new \Magento\Core\Exception($exceptionMessage);
@@ -1070,7 +1066,7 @@ protected function _initCardsStorage($payment)
* Return cards storage model
*
* @param \Magento\Payment\Model\Info $payment
- * @return \Magento\Paygate\Model\Authorizenet\Cards
+ * @return \Magento\Authorizenet\Model\Authorizenet\Cards
*/
public function getCardsStorage($payment = null)
{
@@ -1224,7 +1220,7 @@ protected function _processPartialAuthorizationResponse($response, $orderPayment
/**
* Return authorize payment request
*
- * @return \Magento\Paygate\Model\Authorizenet\Request
+ * @return \Magento\Authorizenet\Model\Authorizenet\Request
*/
protected function _getRequest()
{
@@ -1244,7 +1240,7 @@ protected function _getRequest()
*
* @link http://www.authorize.net/support/AIM_guide.pdf
* @param \Magento\Object|\Magento\Payment\Model\Info $payment
- * @return \Magento\Paygate\Model\Authorizenet\Request
+ * @return \Magento\Authorizenet\Model\Authorizenet\Request
*/
protected function _buildRequest(\Magento\Object $payment)
{
@@ -1352,8 +1348,8 @@ protected function _buildRequest(\Magento\Object $payment)
/**
* Post request to gateway and return responce
*
- * @param \Magento\Paygate\Model\Authorizenet\Request $request)
- * @return \Magento\Paygate\Model\Authorizenet\Result
+ * @param \Magento\Authorizenet\Model\Authorizenet\Request $request)
+ * @return \Magento\Authorizenet\Model\Authorizenet\Result
*/
protected function _postRequest(\Magento\Object $request)
{
@@ -1366,9 +1362,8 @@ protected function _postRequest(\Magento\Object $request)
$uri = $this->getConfigData('cgi_url');
$client->setUri($uri ? $uri : self::CGI_URL);
$client->setConfig(array(
- 'maxredirects'=>0,
- 'timeout'=>30,
- //'ssltransport' => 'tcp',
+ 'maxredirects' => 0,
+ 'timeout' => 30,
));
foreach ($request->getData() as $key => $value) {
$request->setData($key, str_replace(self::RESPONSE_DELIM_CHAR, '', $value));
@@ -1415,8 +1410,7 @@ protected function _postRequest(\Magento\Object $request)
->setAccNumber($r[50])
->setCardType($r[51])
->setRequestedAmount($r[53])
- ->setBalanceOnCard($r[54])
- ;
+ ->setBalanceOnCard($r[54]);
}
else {
throw new \Magento\Core\Exception(
@@ -1475,7 +1469,7 @@ protected function _registerCard(\Magento\Object $response, \Magento\Sales\Model
* Reset assigned data in payment info model
*
* @param \Magento\Payment\Model\Info
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
*/
private function _clearAssignedData($payment)
{
@@ -1488,8 +1482,7 @@ private function _clearAssignedData($payment)
->setCcExpYear(null)
->setCcSsIssue(null)
->setCcSsStartMonth(null)
- ->setCcSsStartYear(null)
- ;
+ ->setCcSsStartYear(null);
return $this;
}
@@ -1580,7 +1573,7 @@ protected function _processFailureMultitransactionAction($payment, $messages, $i
}
$copyOrder->save();
}
- throw new \Magento\Core\Exception($this->_paygateData->convertMessagesToMessage($messages));
+ throw new \Magento\Core\Exception($this->_authorizenetData->convertMessagesToMessage($messages));
}
/**
@@ -1646,8 +1639,7 @@ protected function _getTransactionDetails($transactionId)
$response
->setResponseCode((string)$responseXmlDocument->transaction->responseCode)
->setResponseReasonCode((string)$responseXmlDocument->transaction->responseReasonCode)
- ->setTransactionStatus((string)$responseXmlDocument->transaction->transactionStatus)
- ;
+ ->setTransactionStatus((string)$responseXmlDocument->transaction->transactionStatus);
return $response;
}
}
View
10 ...ento/Paygate/Model/Authorizenet/Cards.php → ...Authorizenet/Model/Authorizenet/Cards.php
@@ -19,12 +19,12 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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\Paygate\Model\Authorizenet;
+namespace Magento\Authorizenet\Model\Authorizenet;
class Cards
{
@@ -52,7 +52,7 @@ class Cards
* Set payment instance for storing credit card information and partial authorizations
*
* @param \Magento\Payment\Model\Info $payment
- * @return \Magento\Paygate\Model\Authorizenet\Cards
+ * @return \Magento\Authorizenet\Model\Authorizenet\Cards
*/
public function setPayment(\Magento\Payment\Model\Info $payment)
{
@@ -99,7 +99,7 @@ public function registerCard($cardInfo = array())
* Save data from card object in cards storage
*
* @param \Magento\Object $card
- * @return \Magento\Paygate\Model\Authorizenet\Cards
+ * @return \Magento\Authorizenet\Model\Authorizenet\Cards
*/
public function updateCard($card)
{
@@ -185,7 +185,7 @@ public function getRefundedAmount()
/**
* Remove all cards from payment instance
*
- * @return \Magento\Paygate\Model\Authorizenet\Cards
+ * @return \Magento\Authorizenet\Model\Authorizenet\Cards
*/
public function flushCards()
{
View
24 ...ento/Paygate/Model/Authorizenet/Debug.php → ...Authorizenet/Model/Authorizenet/Debug.php
@@ -19,38 +19,38 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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)
*/
/**
- * @method \Magento\Paygate\Model\Resource\Authorizenet\Debug _getResource()
- * @method \Magento\Paygate\Model\Resource\Authorizenet\Debug getResource()
+ * @method \Magento\Authorizenet\Model\Resource\Authorizenet\Debug _getResource()
+ * @method \Magento\Authorizenet\Model\Resource\Authorizenet\Debug getResource()
* @method string getRequestBody()
- * @method \Magento\Paygate\Model\Authorizenet\Debug setRequestBody(string $value)
+ * @method \Magento\Authorizenet\Model\Authorizenet\Debug setRequestBody(string $value)
* @method string getResponseBody()
- * @method \Magento\Paygate\Model\Authorizenet\Debug setResponseBody(string $value)
+ * @method \Magento\Authorizenet\Model\Authorizenet\Debug setResponseBody(string $value)
* @method string getRequestSerialized()
- * @method \Magento\Paygate\Model\Authorizenet\Debug setRequestSerialized(string $value)
+ * @method \Magento\Authorizenet\Model\Authorizenet\Debug setRequestSerialized(string $value)
* @method string getResultSerialized()
- * @method \Magento\Paygate\Model\Authorizenet\Debug setResultSerialized(string $value)
+ * @method \Magento\Authorizenet\Model\Authorizenet\Debug setResultSerialized(string $value)
* @method string getRequestDump()
- * @method \Magento\Paygate\Model\Authorizenet\Debug setRequestDump(string $value)
+ * @method \Magento\Authorizenet\Model\Authorizenet\Debug setRequestDump(string $value)
* @method string getResultDump()
- * @method \Magento\Paygate\Model\Authorizenet\Debug setResultDump(string $value)
+ * @method \Magento\Authorizenet\Model\Authorizenet\Debug setResultDump(string $value)
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\Paygate\Model\Authorizenet;
+namespace Magento\Authorizenet\Model\Authorizenet;
class Debug extends \Magento\Core\Model\AbstractModel
{
protected function _construct()
{
- $this->_init('Magento\Paygate\Model\Resource\Authorizenet\Debug');
+ $this->_init('Magento\Authorizenet\Model\Resource\Authorizenet\Debug');
}
}
View
4 ...to/Paygate/Model/Authorizenet/Request.php → ...thorizenet/Model/Authorizenet/Request.php
@@ -19,13 +19,13 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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\Paygate\Model\Authorizenet;
+namespace Magento\Authorizenet\Model\Authorizenet;
class Request extends \Magento\Object
{
View
4 ...nto/Paygate/Model/Authorizenet/Result.php → ...uthorizenet/Model/Authorizenet/Result.php
@@ -19,13 +19,13 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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\Paygate\Model\Authorizenet;
+namespace Magento\Authorizenet\Model\Authorizenet;
class Result extends \Magento\Object
{
View
6 ...gate/Model/Authorizenet/Source/Cctype.php → ...enet/Model/Authorizenet/Source/Cctype.php
@@ -19,7 +19,7 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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)
*/
@@ -28,10 +28,10 @@
* Authorizenet Payment CC Types Source Model
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\Paygate\Model\Authorizenet\Source;
+namespace Magento\Authorizenet\Model\Authorizenet\Source;
class Cctype extends \Magento\Payment\Model\Source\Cctype
{
View
8 ...del/Authorizenet/Source/PaymentAction.php → ...del/Authorizenet/Source/PaymentAction.php
@@ -19,7 +19,7 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
- * @package Magento_Paygate
+ * @package Magento_Authorizenet
* @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)
*/
@@ -30,7 +30,7 @@
*
* @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\Paygate\Model\Authorizenet\Source;
+namespace Magento\Authorizenet\Model\Authorizenet\Source;
class PaymentAction implements \Magento\Core\Model\Option\ArrayInterface
{
@@ -38,11 +38,11 @@ public function toOptionArray()
{
return array(
array(
- 'value' => \Magento\Paygate\Model\Authorizenet::ACTION_AUTHORIZE,
+ 'value' => \Magento\Authorizenet\Model\Authorizenet::ACTION_AUTHORIZE,
'label' => __('Authorize Only')
),
array(
- 'value' => \Magento\Paygate\Model\Authorizenet::ACTION_AUTHORIZE_CAPTURE,
+ 'value' => \Magento\Authorizenet\Model\Authorizenet::ACTION_AUTHORIZE_CAPTURE,
'label' => __('Authorize and Capture')
),
);
View
33 app/code/Magento/Authorizenet/Model/Directpost.php
@@ -27,7 +27,7 @@
*/
namespace Magento\Authorizenet\Model;
-class Directpost extends \Magento\Paygate\Model\Authorizenet
+class Directpost extends \Magento\Authorizenet\Model\Authorizenet
{
protected $_code = 'authorizenet_directpost';
protected $_formBlockType = 'Magento\Authorizenet\Block\Directpost\Form';
@@ -64,6 +64,11 @@ class Directpost extends \Magento\Paygate\Model\Authorizenet
protected $_response;
/**
+ * @var \Magento\Authorizenet\Helper\HelperInterface
+ */
+ protected $_helper;
+
+ /**
* @param \Magento\Event\ManagerInterface $eventManager
* @param \Magento\Payment\Helper\Data $paymentData
* @param \Magento\Core\Model\Store\Config $coreStoreConfig
@@ -72,16 +77,17 @@ class Directpost extends \Magento\Paygate\Model\Authorizenet
* @param \Magento\Module\ModuleListInterface $moduleList
* @param \Magento\Core\Model\LocaleInterface $locale
* @param \Magento\Centinel\Model\Service $centinelService
- * @param \Magento\Paygate\Model\Authorizenet\CardsFactory $cardsFactory
- * @param \Magento\Paygate\Model\Authorizenet\RequestFactory $requestFactory
- * @param \Magento\Paygate\Model\Authorizenet\ResultFactory $resultFactory
+ * @param \Magento\Authorizenet\Model\Authorizenet\CardsFactory $cardsFactory
+ * @param \Magento\Authorizenet\Model\Authorizenet\RequestFactory $requestFactory
+ * @param \Magento\Authorizenet\Model\Authorizenet\ResultFactory $resultFactory
* @param \Magento\Sales\Model\OrderFactory $orderFactory
* @param \Magento\Session\SessionManagerInterface $session
- * @param \Magento\Paygate\Helper\Data $paygateData
+ * @param \Magento\Authorizenet\Helper\Data $authorizenetData
* @param \Magento\Core\Model\StoreManagerInterface $storeManager
* @param \Magento\Sales\Model\QuoteFactory $quoteFactory
* @param \Magento\Authorizenet\Model\Directpost\RequestFactory $directRequestFactory
* @param \Magento\Authorizenet\Model\Directpost\Response $response
+ * @param \Magento\Authorizenet\Helper\HelperInterface $helper
* @param array $data
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -95,16 +101,17 @@ public function __construct(
\Magento\Module\ModuleListInterface $moduleList,
\Magento\Core\Model\LocaleInterface $locale,
\Magento\Centinel\Model\Service $centinelService,
- \Magento\Paygate\Model\Authorizenet\CardsFactory $cardsFactory,
- \Magento\Paygate\Model\Authorizenet\RequestFactory $requestFactory,
- \Magento\Paygate\Model\Authorizenet\ResultFactory $resultFactory,
+ \Magento\Authorizenet\Model\Authorizenet\CardsFactory $cardsFactory,
+ \Magento\Authorizenet\Model\Authorizenet\RequestFactory $requestFactory,
+ \Magento\Authorizenet\Model\Authorizenet\ResultFactory $resultFactory,
\Magento\Sales\Model\OrderFactory $orderFactory,
\Magento\Session\SessionManagerInterface $session,
- \Magento\Paygate\Helper\Data $paygateData,
+ \Magento\Authorizenet\Helper\Data $authorizenetData,
\Magento\Core\Model\StoreManagerInterface $storeManager,
\Magento\Sales\Model\QuoteFactory $quoteFactory,
\Magento\Authorizenet\Model\Directpost\RequestFactory $directRequestFactory,
\Magento\Authorizenet\Model\Directpost\Response $response,
+ \Magento\Authorizenet\Helper\HelperInterface $helper,
array $data = array()
) {
parent::__construct(
@@ -121,13 +128,14 @@ public function __construct(
$resultFactory,
$orderFactory,
$session,
- $paygateData,
+ $authorizenetData,
$data
);
$this->_storeManager = $storeManager;
$this->_quoteFactory = $quoteFactory;
$this->_requestFactory = $directRequestFactory;
$this->_response = $response;
+ $this->_helper = $helper;
}
/**
@@ -145,7 +153,7 @@ public function validate()
*
* @param \Magento\Object $payment
* @param decimal $amount
- * @return \Magento\Paygate\Model\Authorizenet
+ * @return \Magento\Authorizenet\Model\Authorizenet
* @throws \Magento\Core\Exception
*/
public function authorize(\Magento\Object $payment, $amount)
@@ -374,8 +382,7 @@ public function getRelayUrl($storeId = null)
if ($storeId == null && $this->getStore()) {
$storeId = $this->getStore();
}
- return $this->_storeManager->getStore($storeId)->getBaseUrl(\Magento\Core\Model\Store::URL_TYPE_LINK)
- . 'authorizenet/directpost_payment/response';
+ return $this->_helper->getRelyUrl($storeId);
}
/**
View
8 app/code/Magento/Authorizenet/Model/Directpost/Observer.php
@@ -135,11 +135,11 @@ public function addAdditionalFieldsToResponseFrontend(\Magento\Event\Observer $o
//if success, then set order to session and add new fields
$this->_session->addCheckoutOrderIncrementId($order->getIncrementId());
$this->_session->setLastOrderIncrementId($order->getIncrementId());
- $requestToPaygate = $payment->getMethodInstance()->generateRequestFromOrder($order);
- $requestToPaygate->setControllerActionName($request->getControllerName());
- $requestToPaygate->setIsSecure((string)$this->_storeManager->getStore()->isCurrentlySecure());
+ $requestToAuthorizenet = $payment->getMethodInstance()->generateRequestFromOrder($order);
+ $requestToAuthorizenet->setControllerActionName($request->getControllerName());
+ $requestToAuthorizenet->setIsSecure((string)$this->_storeManager->getStore()->isCurrentlySecure());
- $result['directpost'] = array('fields' => $requestToPaygate->getData());
+ $result['directpost'] = array('fields' => $requestToAuthorizenet->getData());
$response->clearHeader('Location');
$response->setBody($this->_coreData->jsonEncode($result));
View
4 app/code/Magento/Authorizenet/Model/Directpost/Request.php
@@ -84,7 +84,7 @@ public function generateRequestSign($merchantApiLoginId, $merchantTransactionKey
}
/**
- * Set paygate data to request.
+ * Set authorizenet data to request.
*
* @param \Magento\Authorizenet\Model\Directpost $paymentMethod
* @return \Magento\Authorizenet\Model\Directpost\Request
@@ -99,7 +99,7 @@ public function setConstantData(\Magento\Authorizenet\Model\Directpost $paymentM