Skip to content

Commit 064341d

Browse files
author
Hwashiang Yu
committed
Merge remote-tracking branch 'upstream/2.2.9-develop' into MAGETWO-96535
2 parents 2e8e526 + c6cb887 commit 064341d

File tree

215 files changed

+5732
-1191
lines changed

Some content is hidden

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

215 files changed

+5732
-1191
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ atlassian*
4949
/pub/media/import/*
5050
!/pub/media/import/.htaccess
5151
/pub/media/logo/*
52+
/pub/media/custom_options/*
53+
!/pub/media/custom_options/.htaccess
5254
/pub/media/theme/*
5355
/pub/media/theme_customization/*
5456
!/pub/media/theme_customization/.htaccess
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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="StorefrontVerifySecureURLRedirectAuthorizenet">
12+
<annotations>
13+
<features value="Authorizenet"/>
14+
<stories value="Storefront Secure URLs"/>
15+
<title value="Verify Secure URLs For Storefront Authorizenet Pages"/>
16+
<description value="Verify that the Secure URL configuration applies to the Authorizenet pages on the Storefront"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-15704"/>
19+
<group value="authorizenet"/>
20+
<group value="configuration"/>
21+
<group value="secure_storefront_url"/>
22+
</annotations>
23+
<before>
24+
<createData entity="Simple_US_Customer" stepKey="customer"/>
25+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront">
26+
<argument name="Customer" value="$$customer$$"/>
27+
</actionGroup>
28+
<executeJS function="return window.location.host" stepKey="hostname"/>
29+
<magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/>
30+
<magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/>
31+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
32+
</before>
33+
<after>
34+
<magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/>
35+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
36+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
37+
</after>
38+
<executeJS function="return window.location.host" stepKey="hostname"/>
39+
<amOnUrl url="http://{$hostname}/authorizenet" stepKey="goToUnsecureAuthorizenetURL"/>
40+
<seeCurrentUrlEquals url="https://{$hostname}/authorizenet" stepKey="seeSecureAuthorizenetURL"/>
41+
</test>
42+
</tests>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAccountSetInterfaceLocaleActionGroup">
12+
<arguments>
13+
<argument name="localeName" type="string"/>
14+
</arguments>
15+
<!-- Navigate to admin System Account Page-->
16+
<amOnPage url="{{AdminSystemAccountPage.url}}" stepKey="openAdminSystemAccountPage"/>
17+
<!-- Change Admin locale to {{localeName}} -->
18+
<selectOption selector="{{AdminSystemAccountSection.interfaceLocale}}" userInput="{{localeName}}" stepKey="setInterfaceLocale"/>
19+
<fillField selector="{{AdminSystemAccountSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillCurrentPassword"/>
20+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
21+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
22+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the account." stepKey="seeSuccessMessage"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminSystemAccountPage" url="admin/system_account/index/" area="admin" module="Magento_Backend">
12+
<section name="AdminSystemAccountSection"/>
13+
</page>
14+
</pages>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminSystemAccountSection">
12+
<element name="interfaceLocale" type="text" selector="#interface_locale"/>
13+
<element name="currentPassword" type="text" selector="#current_password"/>
14+
</section>
15+
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontPayWithPaypalFromMiniCartActionGroup" extends="StorefrontViewAndEditCartFromMiniCartActionGroup">
11+
<remove keyForRemoval="viewAndEditCart"/>
12+
<remove keyForRemoval="seeInCurrentUrl"/>
13+
<waitForElementVisible selector="{{StorefrontMiniCartSection.payWithPayPal}}" stepKey="waitForPaypalButtonIsVisible"/>
14+
<click selector="{{StorefrontMiniCartSection.payWithPayPal}}" stepKey="clickPayWithPaypalButton"/>
15+
</actionGroup>
16+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@
7171
<data key="value"/>
7272
</entity>
7373

74+
<entity name="DefaultBraintreeWithPaypalConfig" extends="DefaultBraintreeConfig">
75+
<requiredEntity type="active_braintree_paypal">DefaultActiveBraintreePaypal</requiredEntity>
76+
</entity>
77+
<entity name="DefaultActiveBraintreePaypal" type="active_braintree_paypal">
78+
<data key="value">0</data>
79+
</entity>
80+
7481
<entity name="SandboxBraintreeConfig" type="braintree_config_state">
7582
<requiredEntity type="title">EnabledTitle</requiredEntity>
7683
<requiredEntity type="payment_action">AuthorizePaymentAction</requiredEntity>
@@ -106,6 +113,13 @@
106113
<data key="value">Magneto</data>
107114
</entity>
108115

116+
<entity name="SandboxBraintreeWithPaypalConfig" extends="SandboxBraintreeConfig">
117+
<requiredEntity type="active_braintree_paypal">EnableActiveBraintreePaypal</requiredEntity>
118+
</entity>
119+
<entity name="EnableActiveBraintreePaypal" type="active_braintree_paypal">
120+
<data key="value">1</data>
121+
</entity>
122+
109123
<entity name="BraintreeCard" type="creditCard">
110124
<data key="cc_type">MasterCard</data>
111125
<data key="card_number">5105105105105100</data>

app/code/Magento/Braintree/Test/Mftf/Metadata/braintree_config-meta.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
<object key="active" dataType="active">
5050
<field key="value">integer</field>
5151
</object>
52+
<object key="active_braintree_paypal" dataType="active_braintree_paypal">
53+
<field key="value">integer</field>
54+
</object>
5255
</object>
5356
</object>
5457
</object>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="StorefrontPaypalReviewOrderPage" url="/braintree/paypal/review" area="storefront" module="Magento_Braintree">
12+
<section name="StorefrontPaypalReviewOrderShippingSection"/>
13+
<section name="StorefrontPaypalReviewOrderItemsSection"/>
14+
</page>
15+
</pages>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontMiniCartSection">
12+
<element name="payWithPayPal" type="button" selector=".braintree-paypal-button-hidden" timeout="30"/>
13+
<element name="proceedWithSandboxPurchase" type="text" selector="#return_url"/>
14+
</section>
15+
</sections>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontPaypalReviewOrderItemsSection">
12+
<element name="placeOrder" type="button" selector="#review-button" timeout="30"/>
13+
<element name="orderSummaryTotal" type="text" selector="tr.grand.totals span.price"/>
14+
</section>
15+
</sections>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontPaypalReviewOrderShippingSection">
12+
<element name="selectShippingMethodByName" type="select" selector="//select[@id='shipping-method']//option[contains(text(),'{{shippingMethod}}')]" parameterized="true"/>
13+
</section>
14+
</sections>

app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @var \Magento\Braintree\Block\Paypal\Button $block
99
*/
1010

11-
$id = $block->getContainerId() . mt_rand();
11+
$id = $block->getContainerId() . random_int(0, PHP_INT_MAX);
1212

1313
$config = [
1414
'Magento_Braintree/js/paypal/button' => [
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Bundle\Block\DataProviders;
9+
10+
use Magento\Catalog\Model\Product;
11+
use Magento\Catalog\Pricing\Price\TierPrice;
12+
use Magento\Framework\Pricing\Render;
13+
use Magento\Framework\View\Element\Block\ArgumentInterface;
14+
use Magento\Framework\View\LayoutInterface;
15+
16+
/**
17+
* Provides additional data for bundle options
18+
*/
19+
class OptionPriceRenderer implements ArgumentInterface
20+
{
21+
/**
22+
* Parent layout of the block
23+
*
24+
* @var LayoutInterface
25+
*/
26+
private $layout;
27+
28+
/**
29+
* @param LayoutInterface $layout
30+
*/
31+
public function __construct(LayoutInterface $layout)
32+
{
33+
$this->layout = $layout;
34+
}
35+
36+
/**
37+
* Format tier price string
38+
*
39+
* @param Product $selection
40+
* @param array $arguments
41+
* @return string
42+
*/
43+
public function renderTierPrice(Product $selection, array $arguments = []): string
44+
{
45+
if (!array_key_exists('zone', $arguments)) {
46+
$arguments['zone'] = Render::ZONE_ITEM_OPTION;
47+
}
48+
49+
$priceHtml = '';
50+
51+
/** @var Render $priceRender */
52+
$priceRender = $this->layout->getBlock('product.price.render.default');
53+
if ($priceRender !== false) {
54+
$priceHtml = $priceRender->render(
55+
TierPrice::PRICE_CODE,
56+
$selection,
57+
$arguments
58+
);
59+
}
60+
61+
return $priceHtml;
62+
}
63+
}

0 commit comments

Comments
 (0)