Skip to content

Commit

Permalink
2.0.0.0-dev62
Browse files Browse the repository at this point in the history
* 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
magento-team committed Jan 24, 2014
1 parent fa01f82 commit 8f72656
Show file tree
Hide file tree
Showing 1,173 changed files with 17,016 additions and 12,853 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions app/code/Magento/AdminNotification/Block/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,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
Expand All @@ -75,6 +83,7 @@ public function __construct(
parent::__construct($context, $data);
$this->_authSession = $authSession;
$this->_criticalCollection = $criticalCollection;
$this->_isScopePrivate = true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -62,7 +62,7 @@ public function getCardsBlock()
*/
public function getCancelUrl()
{
return $this->getUrl('paygate/authorizenet_payment/cancel');
return $this->getUrl('authorizenet/authorizenet_payment/cancel');
}

/**
Expand All @@ -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');
}

/**
Expand Down Expand Up @@ -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.');
}
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -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();
}

Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand All @@ -28,10 +28,10 @@
* Authorize Payment Controller
*
* @category Magento
* @package Magento_Paygate
* @package Magento_Authorizenet
* @author Magento Core Team <[email protected]>
*/
namespace Magento\Paygate\Controller\Adminhtml\Paygate\Authorizenet;
namespace Magento\Authorizenet\Controller\Adminhtml\Authorizenet;

class Payment extends \Magento\Backend\App\Action
{
Expand Down Expand Up @@ -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(
Expand All @@ -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();
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*/
namespace Magento\Paygate\Controller\Authorizenet;
namespace Magento\Authorizenet\Controller\Authorizenet;

class Payment extends \Magento\App\Action\Action
{
Expand Down Expand Up @@ -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();
Expand All @@ -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;
}
}
23 changes: 21 additions & 2 deletions app/code/Magento/Authorizenet/Controller/Directpost/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,31 @@ protected function _getDirectPostSession()
return $this->_objectManager->get('Magento\Authorizenet\Model\Directpost\Session');
}

/**
* 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();
Expand Down Expand Up @@ -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);
Expand Down
Loading

0 comments on commit 8f72656

Please sign in to comment.