Skip to content

Commit 7265204

Browse files
committed
Merge remote-tracking branch 'mainline/2.3-develop' into MC-18450
2 parents 2b181d2 + 88d78b2 commit 7265204

File tree

37 files changed

+785
-257
lines changed

37 files changed

+785
-257
lines changed
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/Catalog/Model/Product.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,12 +832,14 @@ public function getStoreIds()
832832
if (!$this->hasStoreIds()) {
833833
$storeIds = [];
834834
if ($websiteIds = $this->getWebsiteIds()) {
835-
if ($this->_storeManager->isSingleStoreMode()) {
835+
if (!$this->isObjectNew() && $this->_storeManager->isSingleStoreMode()) {
836836
$websiteIds = array_keys($websiteIds);
837837
}
838838
foreach ($websiteIds as $websiteId) {
839839
$websiteStores = $this->_storeManager->getWebsite($websiteId)->getStoreIds();
840-
$storeIds = array_merge($storeIds, $websiteStores);
840+
foreach ($websiteStores as $websiteStore) {
841+
$storeIds []= $websiteStore;
842+
}
841843
}
842844
}
843845
$this->setStoreIds($storeIds);
@@ -920,9 +922,9 @@ public function beforeSave()
920922
//Validate changing of design.
921923
$userType = $this->getUserContext()->getUserType();
922924
if ((
923-
$userType === UserContextInterface::USER_TYPE_ADMIN
925+
$userType === UserContextInterface::USER_TYPE_ADMIN
924926
|| $userType === UserContextInterface::USER_TYPE_INTEGRATION
925-
)
927+
)
926928
&& !$this->getAuthorization()->isAllowed('Magento_Catalog::edit_product_design')
927929
) {
928930
$this->setData('custom_design', $this->getOrigData('custom_design'));

app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\Api\ExtensibleDataInterface;
1414
use Magento\Framework\Api\ExtensionAttributesFactory;
1515
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
16+
use Magento\Store\Model\StoreManagerInterface;
1617

1718
/**
1819
* Product Test
@@ -207,6 +208,11 @@ class ProductTest extends \PHPUnit\Framework\TestCase
207208
*/
208209
private $eavConfig;
209210

211+
/**
212+
* @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject
213+
*/
214+
private $storeManager;
215+
210216
/**
211217
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
212218
*/
@@ -303,13 +309,13 @@ protected function setUp()
303309
->disableOriginalConstructor()
304310
->getMock();
305311

306-
$storeManager = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class)
312+
$this->storeManager = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class)
307313
->disableOriginalConstructor()
308314
->getMockForAbstractClass();
309-
$storeManager->expects($this->any())
315+
$this->storeManager->expects($this->any())
310316
->method('getStore')
311317
->will($this->returnValue($this->store));
312-
$storeManager->expects($this->any())
318+
$this->storeManager->expects($this->any())
313319
->method('getWebsite')
314320
->will($this->returnValue($this->website));
315321
$this->indexerRegistryMock = $this->createPartialMock(
@@ -394,7 +400,7 @@ protected function setUp()
394400
'extensionFactory' => $this->extensionAttributesFactory,
395401
'productPriceIndexerProcessor' => $this->productPriceProcessor,
396402
'catalogProductOptionFactory' => $optionFactory,
397-
'storeManager' => $storeManager,
403+
'storeManager' => $this->storeManager,
398404
'resource' => $this->resource,
399405
'registry' => $this->registry,
400406
'moduleManager' => $this->moduleManager,
@@ -450,6 +456,48 @@ public function testGetStoreIds()
450456
$this->assertEquals($expectedStoreIds, $this->model->getStoreIds());
451457
}
452458

459+
/**
460+
* @dataProvider getSingleStoreIds
461+
* @param bool $isObjectNew
462+
*/
463+
public function testGetStoreSingleSiteModelIds(
464+
bool $isObjectNew
465+
) {
466+
$websiteIDs = [0 => 2];
467+
$this->model->setWebsiteIds(
468+
!$isObjectNew ? $websiteIDs : array_flip($websiteIDs)
469+
);
470+
471+
$this->model->isObjectNew($isObjectNew);
472+
473+
$this->storeManager->expects(
474+
$this->exactly(
475+
(int) !$isObjectNew
476+
)
477+
)
478+
->method('isSingleStoreMode')
479+
->will($this->returnValue(true));
480+
481+
$this->website->expects(
482+
$this->once()
483+
)->method('getStoreIds')
484+
->will($this->returnValue($websiteIDs));
485+
486+
$this->assertEquals($websiteIDs, $this->model->getStoreIds());
487+
}
488+
489+
public function getSingleStoreIds()
490+
{
491+
return [
492+
[
493+
false
494+
],
495+
[
496+
true
497+
],
498+
];
499+
}
500+
453501
public function testGetStoreId()
454502
{
455503
$this->model->setStoreId(3);
@@ -1221,8 +1269,7 @@ public function testGetMediaGalleryImagesMerging()
12211269
{
12221270
$mediaEntries =
12231271
[
1224-
'images' =>
1225-
[
1272+
'images' => [
12261273
[
12271274
'value_id' => 1,
12281275
'file' => 'imageFile.jpg',

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<argument name="total" value="110.00"/>
110110
</actionGroup>
111111

112-
<!--Enabled Shopping Cart Sidebar -->
112+
<!--Enabled Mini Cart -->
113113
<magentoCLI stepKey="enableShoppingCartSidebar" command="config:set checkout/sidebar/display 1"/>
114114
<magentoCLI command="cache:flush" stepKey="flushCache"/>
115115
<reloadPage stepKey="reloadThePage"/>

app/code/Magento/Checkout/etc/adminhtml/system.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
</field>
5858
</group>
5959
<group id="sidebar" translate="label" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1">
60-
<label>Shopping Cart Sidebar</label>
60+
<label>Mini Cart</label>
6161
<field id="display" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
62-
<label>Display Shopping Cart Sidebar</label>
62+
<label>Display Mini Cart</label>
6363
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
6464
</field>
6565
<field id="count" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">

app/code/Magento/Checkout/i18n/en_US.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ Shipping,Shipping
156156
"Number of Items to Display Pager","Number of Items to Display Pager"
157157
"My Cart Link","My Cart Link"
158158
"Display Cart Summary","Display Cart Summary"
159-
"Shopping Cart Sidebar","Shopping Cart Sidebar"
160-
"Display Shopping Cart Sidebar","Display Shopping Cart Sidebar"
159+
"Mini Cart","Mini Cart"
160+
"Display Mini Cart","Display Mini Cart"
161161
"Number of Items to Display Scrollbar","Number of Items to Display Scrollbar"
162162
"Maximum Number of Items to Display","Maximum Number of Items to Display"
163163
"Payment Failed Emails","Payment Failed Emails"

app/code/Magento/Checkout/view/frontend/templates/cart/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<span><?= $block->escapeHtml(__('Continue Shopping')) ?></span>
5757
</a>
5858
<?php endif; ?>
59-
<button type="submit"
59+
<button type="button"
6060
name="update_cart_action"
6161
data-cart-empty=""
6262
value="empty_cart"

app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ define([
1414
_create: function () {
1515
var items, i, reload;
1616

17-
$(this.options.emptyCartButton).on('click', $.proxy(function (event) {
18-
if (event.detail === 0) {
19-
return;
20-
}
21-
17+
$(this.options.emptyCartButton).on('click', $.proxy(function () {
2218
$(this.options.emptyCartButton).attr('name', 'update_cart_action_temp');
2319
$(this.options.updateCartActionContainer)
2420
.attr('name', 'update_cart_action').attr('value', 'empty_cart');
21+
22+
if ($(this.options.emptyCartButton).parents('form').length > 0) {
23+
$(this.options.emptyCartButton).parents('form').submit();
24+
}
2525
}, this));
2626
items = $.find('[data-role="cart-item-qty"]');
2727

app/code/Magento/Cron/etc/adminhtml/system.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,27 @@
1515
<label>Cron configuration options for group: </label>
1616
<field id="schedule_generate_every" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
1717
<label>Generate Schedules Every</label>
18+
<validate>validate-zero-or-greater validate-digits</validate>
1819
</field>
1920
<field id="schedule_ahead_for" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
2021
<label>Schedule Ahead for</label>
22+
<validate>validate-zero-or-greater validate-digits</validate>
2123
</field>
2224
<field id="schedule_lifetime" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
2325
<label>Missed if Not Run Within</label>
26+
<validate>validate-zero-or-greater validate-digits</validate>
2427
</field>
2528
<field id="history_cleanup_every" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
2629
<label>History Cleanup Every</label>
30+
<validate>validate-zero-or-greater validate-digits</validate>
2731
</field>
2832
<field id="history_success_lifetime" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
2933
<label>Success History Lifetime</label>
34+
<validate>validate-zero-or-greater validate-digits</validate>
3035
</field>
3136
<field id="history_failure_lifetime" translate="label" type="text" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
3237
<label>Failure History Lifetime</label>
38+
<validate>validate-zero-or-greater validate-digits</validate>
3339
</field>
3440
<field id="use_separate_process" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
3541
<label>Use Separate Process</label>

0 commit comments

Comments
 (0)