Skip to content

Commit 7b9780b

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MC-19783
2 parents 9097ecc + d354290 commit 7b9780b

File tree

196 files changed

+5435
-1431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+5435
-1431
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
5050

5151
const VALIDATOR_WEBSITE = 'validator_website';
5252

53-
const VALIDATOR_TEAR_PRICE = 'validator_tear_price';
53+
/**
54+
* @deprecated
55+
* @see VALIDATOR_TIER_PRICE
56+
*/
57+
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';
58+
59+
private const VALIDATOR_TIER_PRICE = 'validator_tier_price';
5460

5561
/**
5662
* Validation failure message template definitions.
@@ -221,7 +227,7 @@ public function __construct(
221227
$this->_catalogProductEntity = $this->_resourceFactory->create()->getTable('catalog_product_entity');
222228
$this->_oldSkus = $this->retrieveOldSkus();
223229
$this->_validators[self::VALIDATOR_WEBSITE] = $websiteValidator;
224-
$this->_validators[self::VALIDATOR_TEAR_PRICE] = $tierPriceValidator;
230+
$this->_validators[self::VALIDATOR_TIER_PRICE] = $tierPriceValidator;
225231
$this->errorAggregator = $errorAggregator;
226232

227233
foreach (array_merge($this->errorMessageTemplates, $this->_messageTemplates) as $errorCode => $message) {
@@ -536,7 +542,7 @@ protected function getWebSiteId($websiteCode)
536542
*/
537543
protected function getCustomerGroupId($customerGroup)
538544
{
539-
$customerGroups = $this->_getValidator(self::VALIDATOR_TEAR_PRICE)->getCustomerGroups();
545+
$customerGroups = $this->_getValidator(self::VALIDATOR_TIER_PRICE)->getCustomerGroups();
540546
return $customerGroup == self::VALUE_ALL_GROUPS ? 0 : $customerGroups[$customerGroup];
541547
}
542548

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\AbstractImportTestCase
1717
{
18+
/**
19+
* DB Table data
20+
*/
1821
const TABLE_NAME = 'tableName';
1922
const LINK_FIELD = 'linkField';
2023

@@ -54,7 +57,7 @@ class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\A
5457
protected $websiteValidator;
5558

5659
/**
57-
* @var AdvancedPricing\Validator\TearPrice |\PHPUnit_Framework_MockObject_MockObject
60+
* @var AdvancedPricing\Validator\TierPrice |\PHPUnit_Framework_MockObject_MockObject
5861
*/
5962
protected $tierPriceValidator;
6063

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1+
# Magento_Authorizenet module
2+
13
The Magento_Authorizenet module implements the integration with the Authorize.Net payment gateway and makes the latter available as a payment method in Magento.
4+
5+
## Extensibility
6+
7+
Extension developers can interact with the Magento_Authorizenet module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
8+
9+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Authorizenet module.
10+
11+
### Events
12+
13+
This module dispatches the following events:
14+
15+
- `checkout_directpost_placeOrder` event in the `\Magento\Authorizenet\Controller\Directpost\Payment\Place::placeCheckoutOrder()` method. Parameters:
16+
- `result` is a data object (`\Magento\Framework\DataObject` class).
17+
- `action` is a controller object (`\Magento\Authorizenet\Controller\Directpost\Payment\Place`).
18+
19+
- `order_cancel_after` event in the `\Magento\Authorizenet\Model\Directpost::declineOrder()` method. Parameters:
20+
- `order` is an order object (`\Magento\Sales\Model\Order` class).
21+
22+
23+
This module observes the following events:
24+
25+
- `checkout_submit_all_after` event in the `Magento\Authorizenet\Observer\SaveOrderAfterSubmitObserver` file.
26+
- `checkout_directpost_placeOrder` event in the `Magento\Authorizenet\Observer\AddFieldsToResponseObserver` file.
27+
28+
For information about events in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events).
29+
30+
### Layouts
31+
32+
This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory:
33+
34+
- `adminhtml_authorizenet_directpost_payment_redirect`
35+
36+
This module introduces the following layouts and layout handles in the `view/frontend/layout` directory:
37+
38+
- `authorizenet_directpost_payment_backendresponse`
39+
- `authorizenet_directpost_payment_redirect`
40+
- `authorizenet_directpost_payment_response`
41+
42+
For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html).

app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface;
1111
use Magento\Framework\Stdlib\ArrayManager;
12+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1213

1314
/**
1415
* SetPaymentMethod additional data provider model for Authorizenet payment method
@@ -36,10 +37,32 @@ public function __construct(
3637
*
3738
* @param array $data
3839
* @return array
40+
* @throws GraphQlInputException
3941
*/
4042
public function getData(array $data): array
4143
{
42-
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data) ?? [];
44+
if (!isset($data[self::PATH_ADDITIONAL_DATA])) {
45+
throw new GraphQlInputException(
46+
__('Required parameter "authorizenet_acceptjs" for "payment_method" is missing.')
47+
);
48+
}
49+
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_descriptor'])) {
50+
throw new GraphQlInputException(
51+
__('Required parameter "opaque_data_descriptor" for "authorizenet_acceptjs" is missing.')
52+
);
53+
}
54+
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_value'])) {
55+
throw new GraphQlInputException(
56+
__('Required parameter "opaque_data_value" for "authorizenet_acceptjs" is missing.')
57+
);
58+
}
59+
if (!isset($data[self::PATH_ADDITIONAL_DATA]['cc_last_4'])) {
60+
throw new GraphQlInputException(
61+
__('Required parameter "cc_last_4" for "authorizenet_acceptjs" is missing.')
62+
);
63+
}
64+
65+
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data);
4366
foreach ($additionalData as $key => $value) {
4467
$additionalData[$this->convertSnakeCaseToCamelCase($key)] = $value;
4568
unset($additionalData[$key]);

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public function __construct(
3939
$this->locator = $locator;
4040
$this->arrayManager = $arrayManager;
4141
}
42-
42+
4343
/**
44-
* {@inheritdoc}
44+
* @inheritdoc
4545
*/
4646
public function modifyMeta(array $meta)
4747
{
@@ -64,7 +64,7 @@ public function modifyMeta(array $meta)
6464
$this->arrayManager->findPath(
6565
ProductAttributeInterface::CODE_PRICE,
6666
$meta,
67-
null,
67+
self::DEFAULT_GENERAL_PANEL . '/children',
6868
'children'
6969
) . static::META_CONFIG_PATH,
7070
$meta,
@@ -94,7 +94,7 @@ public function modifyMeta(array $meta)
9494
}
9595

9696
/**
97-
* {@inheritdoc}
97+
* @inheritdoc
9898
*/
9999
public function modifyData(array $data)
100100
{

app/code/Magento/Captcha/Observer/CheckContactUsFormObserver.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\Framework\App\Request\DataPersistorInterface;
1010
use Magento\Framework\App\ObjectManager;
1111

12+
/**
13+
* Class CheckContactUsFormObserver
14+
*/
1215
class CheckContactUsFormObserver implements ObserverInterface
1316
{
1417
/**
@@ -76,7 +79,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
7679
/** @var \Magento\Framework\App\Action\Action $controller */
7780
$controller = $observer->getControllerAction();
7881
if (!$captcha->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId))) {
79-
$this->messageManager->addError(__('Incorrect CAPTCHA.'));
82+
$this->messageManager->addErrorMessage(__('Incorrect CAPTCHA.'));
8083
$this->getDataPersistor()->set($formId, $controller->getRequest()->getPostValue());
8184
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
8285
$this->redirect->redirect($controller->getResponse(), 'contact/index/index');

app/code/Magento/Captcha/Observer/CheckForgotpasswordObserver.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
use Magento\Framework\Event\ObserverInterface;
99

10+
/**
11+
* Class CheckForgotpasswordObserver
12+
*/
1013
class CheckForgotpasswordObserver implements ObserverInterface
1114
{
1215
/**
@@ -69,7 +72,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
6972
/** @var \Magento\Framework\App\Action\Action $controller */
7073
$controller = $observer->getControllerAction();
7174
if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId))) {
72-
$this->messageManager->addError(__('Incorrect CAPTCHA'));
75+
$this->messageManager->addErrorMessage(__('Incorrect CAPTCHA'));
7376
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
7477
$this->redirect->redirect($controller->getResponse(), '*/*/forgotpassword');
7578
}

app/code/Magento/Captcha/Observer/CheckUserCreateObserver.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
use Magento\Framework\Event\ObserverInterface;
99

10+
/**
11+
* Class CheckUserCreateObserver
12+
*
13+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
14+
*/
1015
class CheckUserCreateObserver implements ObserverInterface
1116
{
1217
/**
@@ -86,7 +91,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
8691
/** @var \Magento\Framework\App\Action\Action $controller */
8792
$controller = $observer->getControllerAction();
8893
if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId))) {
89-
$this->messageManager->addError(__('Incorrect CAPTCHA'));
94+
$this->messageManager->addErrorMessage(__('Incorrect CAPTCHA'));
9095
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
9196
$this->_session->setCustomerFormData($controller->getRequest()->getPostValue());
9297
$url = $this->_urlManager->getUrl('*/*/create', ['_nosecret' => true]);

app/code/Magento/Captcha/Observer/CheckUserEditObserver.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
use Magento\Framework\App\Config\ScopeConfigInterface;
1212

1313
/**
14-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
14+
* Class CheckUserEditObserver
15+
*
16+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1517
*/
1618
class CheckUserEditObserver implements ObserverInterface
1719
{
18-
/**
19-
* Form ID
20-
*/
2120
const FORM_ID = 'user_edit';
2221

2322
/**
@@ -96,7 +95,8 @@ public function __construct(
9695
* Check Captcha On Forgot Password Page
9796
*
9897
* @param \Magento\Framework\Event\Observer $observer
99-
* @return $this
98+
* @return $this|void
99+
* @throws \Magento\Framework\Exception\SessionException
100100
*/
101101
public function execute(\Magento\Framework\Event\Observer $observer)
102102
{
@@ -119,9 +119,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
119119
'The account is locked. Please wait and try again or contact %1.',
120120
$this->scopeConfig->getValue('contact/email/recipient_email')
121121
);
122-
$this->messageManager->addError($message);
122+
$this->messageManager->addErrorMessage($message);
123123
}
124-
$this->messageManager->addError(__('Incorrect CAPTCHA'));
124+
$this->messageManager->addErrorMessage(__('Incorrect CAPTCHA'));
125125
$this->actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
126126
$this->redirect->redirect($controller->getResponse(), '*/*/edit');
127127
}

app/code/Magento/Captcha/Observer/CheckUserForgotPasswordBackendObserver.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
use Magento\Framework\Event\ObserverInterface;
99

10+
/**
11+
* Class CheckUserForgotPasswordBackendObserver
12+
*
13+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
14+
*/
1015
class CheckUserForgotPasswordBackendObserver implements ObserverInterface
1116
{
1217
/**
@@ -76,7 +81,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
7681
) {
7782
$this->_session->setEmail((string)$controller->getRequest()->getPost('email'));
7883
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
79-
$this->messageManager->addError(__('Incorrect CAPTCHA'));
84+
$this->messageManager->addErrorMessage(__('Incorrect CAPTCHA'));
8085
$controller->getResponse()->setRedirect(
8186
$controller->getUrl('*/*/forgotpassword', ['_nosecret' => true])
8287
);

0 commit comments

Comments
 (0)