Skip to content

Commit da4e5c1

Browse files
committed
Merge remote-tracking branch 'github/2.3-develop' into MC-18709
2 parents f97b59d + 14a4c24 commit da4e5c1

File tree

373 files changed

+12705
-2311
lines changed

Some content is hidden

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

373 files changed

+12705
-2311
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

app/code/Magento/AmqpStore/Plugin/Framework/Amqp/Bulk/Exchange.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function beforeEnqueue(SubjectExchange $subject, $topic, array $envelopes
9191
if ($headers instanceof AMQPTable) {
9292
try {
9393
$headers->set('store_id', $storeId);
94-
// phpcs:ignore Magento2.Exceptions.ThrowCatch
9594
} catch (AMQPInvalidArgumentException $ea) {
9695
$errorMessage = sprintf("Can't set storeId to amqp message. Error %s.", $ea->getMessage());
9796
$this->logger->error($errorMessage);
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/Backup/Controller/Adminhtml/Index/Rollback.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public function execute()
127127
$adminSession->destroy();
128128

129129
$response->setRedirectUrl($this->getUrl('*'));
130-
// phpcs:disable Magento2.Exceptions.ThrowCatch
131130
} catch (\Magento\Framework\Backup\Exception\CantLoadSnapshot $e) {
132131
$errorMsg = __('We can\'t find the backup file.');
133132
} catch (\Magento\Framework\Backup\Exception\FtpConnectionFailed $e) {

app/code/Magento/Braintree/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
"magento/module-sales": "*",
2323
"magento/module-ui": "*",
2424
"magento/module-vault": "*",
25-
"magento/module-multishipping": "*"
25+
"magento/module-multishipping": "*",
26+
"magento/module-theme": "*"
2627
},
2728
"suggest": {
28-
"magento/module-checkout-agreements": "*",
29-
"magento/module-theme": "*"
29+
"magento/module-checkout-agreements": "*"
3030
},
3131
"type": "magento2-module",
3232
"license": [

app/code/Magento/Bundle/Plugin/UpdatePriceInQuoteItemOptions.php

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminAssociateBundleProductToWebsitesTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Create/Edit bundle product in Admin"/>
15+
<title value="Admin should be able to associate bundle product to websites"/>
16+
<description value="Admin should be able to associate bundle product to websites"/>
17+
<testCaseId value="MC-3344"/>
18+
<severity value="CRITICAL"/>
19+
<group value="bundle"/>
20+
<group value="catalog"/>
21+
</annotations>
22+
<before>
23+
<!-- Configure Store URLs -->
24+
<magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToYes"/>
25+
26+
<!-- Create category -->
27+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
28+
29+
<!-- Create Simple product -->
30+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
31+
32+
<!-- Create Bundle product -->
33+
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct">
34+
<requiredEntity createDataKey="createCategory"/>
35+
</createData>
36+
<createData entity="DropDownBundleOption" stepKey="bundleOption">
37+
<requiredEntity createDataKey="createBundleProduct"/>
38+
</createData>
39+
<createData entity="ApiBundleLink" stepKey="createNewBundleLink">
40+
<requiredEntity createDataKey="createBundleProduct"/>
41+
<requiredEntity createDataKey="bundleOption"/>
42+
<requiredEntity createDataKey="createSimpleProduct"/>
43+
</createData>
44+
45+
<!-- Reindex -->
46+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
47+
48+
<!-- Login as admin -->
49+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
50+
51+
<!--Create website-->
52+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite">
53+
<argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/>
54+
<argument name="websiteCode" value="{{secondCustomWebsite.code}}"/>
55+
</actionGroup>
56+
<!-- Create second store -->
57+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createSecondStoreGroup">
58+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
59+
<argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/>
60+
<argument name="storeGroupCode" value="{{SecondStoreGroupUnique.code}}"/>
61+
</actionGroup>
62+
<!-- Create second store view -->
63+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView">
64+
<argument name="StoreGroup" value="SecondStoreGroupUnique"/>
65+
<argument name="customStore" value="SecondStoreUnique"/>
66+
</actionGroup>
67+
</before>
68+
<after>
69+
<!-- Disabled Store URLs -->
70+
<magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToNo"/>
71+
72+
<!-- Delete simple product -->
73+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
74+
<!-- Delete bundle product -->
75+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
76+
77+
<!-- Delete second website -->
78+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
79+
<argument name="websiteName" value="{{secondCustomWebsite.name}}"/>
80+
</actionGroup>
81+
82+
<actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="resetProductGridFilter"/>
83+
84+
<!-- Admin logout -->
85+
<actionGroup ref="logout" stepKey="adminLogout"/>
86+
</after>
87+
88+
<!-- Open product page and assign grouped project to second website -->
89+
<actionGroup ref="filterAndSelectProduct" stepKey="openAdminProductPage">
90+
<argument name="productSku" value="$$createBundleProduct.sku$$"/>
91+
</actionGroup>
92+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductToSecondWebsite">
93+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
94+
</actionGroup>
95+
<actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="unassignProductFromDefaultWebsite">
96+
<argument name="website" value="{{_defaultWebsite.name}}"/>
97+
</actionGroup>
98+
<actionGroup ref="saveProductForm" stepKey="saveGroupedProduct"/>
99+
100+
<!-- Assert product is assigned to Second website -->
101+
<actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked">
102+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
103+
</actionGroup>
104+
105+
<!-- Assert product is not assigned to Main website -->
106+
<actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked">
107+
<argument name="website" value="{{_defaultWebsite.name}}"/>
108+
</actionGroup>
109+
110+
<!-- Go to frontend and open product on Main website -->
111+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
112+
<argument name="productUrl" value="$$createBundleProduct.custom_attributes[url_key]$$"/>
113+
</actionGroup>
114+
115+
<!-- Assert 404 page -->
116+
<actionGroup ref="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup" stepKey="assertPageNotFoundError">
117+
<argument name="product" value="$$createBundleProduct$$"/>
118+
</actionGroup>
119+
120+
<!-- Assert product is present at Second website -->
121+
<actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl">
122+
<argument name="product" value="$$createBundleProduct$$"/>
123+
<argument name="storeView" value="SecondStoreUnique"/>
124+
</actionGroup>
125+
</test>
126+
</tests>

0 commit comments

Comments
 (0)