Skip to content

Commit 6147d27

Browse files
committed
Merge remote-tracking branch 'origin/2.4.0-develop' into MC-34941
# Conflicts: # app/code/Magento/Paypal/Test/Mftf/Suite/InContextPaypalSuite.xml
2 parents 9a1e79f + ad516cc commit 6147d27

17 files changed

+247
-37
lines changed

app/code/Magento/Downloadable/Model/Sample/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function __construct(
7676
* Init data for builder
7777
*
7878
* @param array $data
79-
* @return $this;
79+
* @return $this
8080
* @since 100.1.0
8181
*/
8282
public function setData(array $data)

app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckingWithCartPriceRuleMatchingSubtotalForMultiShipmentTest.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
<group value="Multishipment"/>
2020
<group value="SalesRule"/>
2121
</annotations>
22-
<before>
23-
<magentoCLI command="config:set multishipping/options/checkout_multiple 1" stepKey="allowShippingToMultipleAddresses"/>
24-
</before>
25-
<after>
26-
<magentoCLI command="config:set multishipping/options/checkout_multiple 0" stepKey="disableShippingToMultipleAddresses"/>
27-
</after>
2822
<actionGroup ref="AdminCreateCartPriceRuleActionsWithSubtotalActionGroup" before="goToProduct1" stepKey="createSubtotalCartPriceRuleActionsSection">
2923
<argument name="ruleName" value="CartPriceRuleConditionForSubtotalForMultiShipping"/>
3024
</actionGroup>

app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
<before>
2323
<!-- Login as Admin -->
2424
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
25-
<!-- Set configurations -->
26-
<magentoCLI command="config:set multishipping/options/checkout_multiple 1" stepKey="allowShippingToMultipleAddresses"/>
2725
<!-- Create simple products -->
2826
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
2927
<createData entity="SimpleProduct" stepKey="firstProduct">

app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<createData entity="SimpleProduct2" stepKey="createProduct2"/>
2828
<createData entity="Simple_US_Customer_Two_Addresses" stepKey="createCustomer"/>
2929
<!-- Set configurations -->
30-
<magentoCLI command="config:set {{EnableMultiShippingCheckoutMultiple.path}} {{EnableMultiShippingCheckoutMultiple.value}}" stepKey="allowShippingToMultipleAddresses"/>
3130
<magentoCLI command="config:set {{EnableFreeShippingMethod.path}} {{EnableFreeShippingMethod.value}}" stepKey="enableFreeShipping"/>
3231
<magentoCLI command="config:set {{EnableFlatRateShippingMethod.path}} {{EnableFlatRateShippingMethod.value}}" stepKey="enableFlatRateShipping"/>
3332
<magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/>
@@ -43,7 +42,6 @@
4342
<!-- Need logout before customer delete. Fatal error appears otherwise -->
4443
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
4544
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
46-
<magentoCLI command="config:set {{DisableMultiShippingCheckoutMultiple.path}} {{DisableMultiShippingCheckoutMultiple.value}}" stepKey="withdrawShippingToMultipleAddresses"/>
4745
<magentoCLI command="config:set {{DisableFreeShippingMethod.path}} {{DisableFreeShippingMethod.value}}" stepKey="disableFreeShipping"/>
4846
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearAllOrdersGridFilters"/>
4947
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>

app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
<before>
2323
<!-- Login as Admin -->
2424
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
25-
<!-- Set configurations -->
26-
<magentoCLI command="config:set multishipping/options/checkout_multiple 1" stepKey="allowShippingToMultipleAddresses"/>
2725
<!-- Create two simple products -->
2826
<createData entity="ApiCategory" stepKey="createCategory"/>
2927
<createData entity="_defaultProduct" stepKey="createFirstProduct">

app/code/Magento/Paypal/Model/SmartButtonConfig.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\App\Config\ScopeConfigInterface;
1212
use Magento\Framework\Locale\ResolverInterface;
1313
use Magento\Store\Model\ScopeInterface;
14-
use Magento\Paypal\Model\Config as PayPalConfig;
14+
use Magento\Store\Model\StoreManagerInterface;
1515

1616
/**
1717
* Provides configuration values for PayPal in-context checkout
@@ -50,6 +50,11 @@ class SmartButtonConfig
5050
*/
5151
private $unsupportedPaymentMethods;
5252

53+
/**
54+
* @var StoreManagerInterface
55+
*/
56+
private $storeManager;
57+
5358
/**
5459
* Base url for Paypal SDK
5560
*/
@@ -59,6 +64,7 @@ class SmartButtonConfig
5964
* @param ResolverInterface $localeResolver
6065
* @param ConfigFactory $configFactory
6166
* @param ScopeConfigInterface $scopeConfig
67+
* @param StoreManagerInterface $storeManager
6268
* @param array $defaultStyles
6369
* @param array $disallowedFundingMap
6470
* @param array $unsupportedPaymentMethods
@@ -67,6 +73,7 @@ public function __construct(
6773
ResolverInterface $localeResolver,
6874
ConfigFactory $configFactory,
6975
ScopeConfigInterface $scopeConfig,
76+
StoreManagerInterface $storeManager,
7077
$defaultStyles = [],
7178
$disallowedFundingMap = [],
7279
$unsupportedPaymentMethods = []
@@ -75,6 +82,7 @@ public function __construct(
7582
$this->config = $configFactory->create();
7683
$this->config->setMethod(Config::METHOD_EXPRESS);
7784
$this->scopeConfig = $scopeConfig;
85+
$this->storeManager = $storeManager;
7886
$this->defaultStyles = $defaultStyles;
7987
$this->disallowedFundingMap = $disallowedFundingMap;
8088
$this->unsupportedPaymentMethods = $unsupportedPaymentMethods;
@@ -123,6 +131,7 @@ private function generatePaypalSdkUrl(string $page): string
123131
'merchant-id' => $this->config->getValue('merchant_id'),
124132
'locale' => $this->localeResolver->getLocale(),
125133
'intent' => $this->getIntent(),
134+
'currency' => $this->storeManager->getStore()->getBaseCurrencyCode(),
126135
];
127136
if ($disallowedFunding) {
128137
$params['disable-funding'] = $disallowedFunding;

app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MC-13690"/>
1919
<group value="paypalExpress"/>
20-
<skip>
21-
<issueId value="MC-33951"/>
22-
</skip>
2320
</annotations>
2421
<before>
2522
<!-- Login -->

app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithAUDCurrencyTest.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
</skip>
2323
</annotations>
2424
<before>
25-
25+
<!--Set price scope global-->
26+
<magentoCLI command="config:set {{CatalogPriceScopeGlobalConfigData.path}} {{CatalogPriceScopeGlobalConfigData.value}}" stepKey="setCatalogPriceScopeWebsite"/>
27+
<!--Remove Currency options for Website-->
28+
<remove keyForRemoval="setCurrencyBaseEURWebsites"/>
29+
<remove keyForRemoval="setAllowedCurrencyWebsitesForEURandUSD"/>
30+
<remove keyForRemoval="setCurrencyDefaultEURWebsites"/>
2631
<!--Enable Advanced Setting-->
2732
<magentoCLI command="config:set {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.value}}" stepKey="enableSkipOrderReview"/>
2833
<!--Set merchant country-->
@@ -31,10 +36,6 @@
3136
<magentoCLI command="config:set {{SetCurrencyAUDBaseConfig.path}} {{SetCurrencyAUDBaseConfig.value}}" stepKey="setCurrencyBaseEUR"/>
3237
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForAUD.value}}" stepKey="setAllowedCurrencyEURandUSD"/>
3338
<magentoCLI command="config:set {{SetDefaultCurrencyAUDConfig.path}} {{SetDefaultCurrencyAUDConfig.value}}" stepKey="setCurrencyDefaultEUR"/>
34-
<!--Set Currency options for Website-->
35-
<magentoCLI command="config:set --scope={{SetCurrencyUSDBaseConfig.scope}} --scope-code={{SetCurrencyUSDBaseConfig.scope_code}} {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="setCurrencyBaseEURWebsites"/>
36-
<magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForAUD.value}}" stepKey="setAllowedCurrencyWebsitesForEURandUSD"/>
37-
<magentoCLI command="config:set --scope={{SetDefaultCurrencyAUDConfig.scope}} --scope-code={{SetDefaultCurrencyAUDConfig.scope_code}} {{SetDefaultCurrencyAUDConfig.path}} {{SetDefaultCurrencyAUDConfig.value}}" stepKey="setCurrencyDefaultEURWebsites"/>
3839
</before>
3940
<after>
4041
<magentoCLI command="config:set {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.value}}" stepKey="disableSkipOrderReview"/>

app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithEuroCurrencyTest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
</skip>
2323
</annotations>
2424
<before>
25+
<!--Set price scope global-->
26+
<magentoCLI command="config:set {{CatalogPriceScopeGlobalConfigData.path}} {{CatalogPriceScopeGlobalConfigData.value}}" stepKey="setCatalogPriceScopeWebsite"/>
27+
<!--Remove Currency options for Website-->
28+
<remove keyForRemoval="setCurrencyBaseEURWebsites"/>
29+
<remove keyForRemoval="setAllowedCurrencyWebsitesForEURandUSD"/>
30+
<remove keyForRemoval="setCurrencyDefaultEURWebsites"/>
2531
<!--Set merchant country-->
2632
<magentoCLI command="config:set {{MerchantUnitedKingdom.path}} {{MerchantUnitedKingdom.value}}" stepKey="setMerchantCountryUK"/>
2733
<!--Enable Advanced Setting-->

app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,28 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-33274"/>
1919
<group value="paypalExpress"/>
20-
<skip>
21-
<issueId value="MC-33951"/>
22-
</skip>
2320
</annotations>
2421
<before>
22+
<!--Set price scope global-->
23+
<magentoCLI command="config:set {{CatalogPriceScopeGlobalConfigData.path}} {{CatalogPriceScopeGlobalConfigData.value}}" stepKey="setCatalogPriceScopeWebsite"/>
2524
<!--Set merchant country-->
2625
<magentoCLI command="config:set {{MerchantFrance.path}} {{MerchantFrance.value}}" stepKey="setMerchantCountryUK"/>
2726
<!--Enable Advanced Setting-->
2827
<magentoCLI command="config:set {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.value}}" stepKey="enableSkipOrderReview"/>
2928
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/>
29+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
3030
</before>
3131
<after>
3232
<magentoCLI command="config:set {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.value}}" stepKey="disableSkipOrderReview"/>
3333
<!--Set default merchant country-->
3434
<magentoCLI command="config:set {{MerchantUnitedStates.path}} {{MerchantUnitedStates.value}}" stepKey="setMerchantCountryDefault"/>
3535
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/>
3636
</after>
37+
<!-- Switch to USD-US Dollar-->
38+
<actionGroup ref="StorefrontSwitchCurrencyActionGroup" after="waitForProductPagePageLoad" stepKey="switchCurrency">
39+
<argument name="currency" value="USD"/>
40+
</actionGroup>
41+
3742
<!-- click on PayPal payment radio button -->
3843
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" after="guestCheckoutFillingShippingSection" stepKey="waitForPlaceOrderButton"/>
3944
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="guestSelectCheckMoneyOrderPayment"/>
@@ -52,5 +57,10 @@
5257
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" after="LoginToPayPal" stepKey="submitPayment"/>
5358

5459
<waitForElement after="submitPayment" selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumber"/>
60+
<see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="USD / EUR rate" stepKey="seeEURandUSDRate"/>
61+
<assertEquals stepKey="assertSelectedCategories">
62+
<actualResult type="variable">grabRate</actualResult>
63+
<expectedResult type="array">[USD / EUR rate:]</expectedResult>
64+
</assertEquals>
5565
</test>
5666
</tests>

0 commit comments

Comments
 (0)