Skip to content

Commit 2f2e37f

Browse files
committed
ACP2E-862: Cash on Delivery method is visible even if it is not allowed for that particular country
1 parent e019c8a commit 2f2e37f

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

app/code/Magento/Checkout/Test/Mftf/ActionGroup/CashOnDeliverySpecificCountryActionGroup.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<arguments>
1717
<argument name="path" type="string" defaultValue="{{CashOnDeliveryDisabledConfigData.path}}"/>
1818
<argument name="value" type="string" defaultValue="{{CashOnDeliveryDisabledConfigData.value}}"/>
19-
<argument name="allowSpecific" type="string" defaultValue="0"/>
20-
<argument name="specificCountry" type="string" defaultValue="''"/>
19+
<argument name="allowSpecific" type="string" defaultValue="{{CashOnDeliveryApplicableAllAllowedCountryConfigData.value}}"/>
20+
<argument name="specificCountry" type="string" defaultValue="{{CashOnDeliveryAllAllowedCountryConfigData.value}}"/>
2121
</arguments>
2222

2323
<magentoCLI command="config:set {{path}} {{value}}" stepKey="enableCashOnDelivery"/>
24-
<magentoCLI command="config:set payment/cashondelivery/allowspecific {{allowSpecific}}" stepKey="allowSpecificValue"/>
25-
<magentoCLI command="config:set payment/cashondelivery/specificcountry {{specificCountry}}" stepKey="specificCountryValue"/>
24+
<magentoCLI command="config:set {{CashOnDeliveryApplicableAllAllowedCountryConfigData.path}} {{allowSpecific}}" stepKey="allowSpecificValue"/>
25+
<magentoCLI command="config:set {{CashOnDeliveryAllAllowedCountryConfigData.path}} {{specificCountry}}" stepKey="specificCountryValue"/>
2626
</actionGroup>
2727
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<actionGroup ref="CashOnDeliverySpecificCountryActionGroup" stepKey="enableCashOnDelivery">
2525
<argument name="path" value="{{CashOnDeliveryEnableConfigData.path}}"/>
2626
<argument name="value" value="{{CashOnDeliveryEnableConfigData.value}}"/>
27-
<argument name="allowSpecific" value="1"/>
27+
<argument name="allowSpecific" value="{{CashOnDeliveryApplicableSpecificCountryConfigData.value}}"/>
2828
<argument name="specificCountry" value="GB"/>
2929
</actionGroup>
3030

app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodConfigData.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,22 @@
4444
<data key="label">No</data>
4545
<data key="value">0</data>
4646
</entity>
47+
<entity name="CashOnDeliveryApplicableSpecificCountryConfigData">
48+
<data key="path">payment/cashondelivery/allowspecific</data>
49+
<data key="scope_id">1</data>
50+
<data key="label">Specific Countries</data>
51+
<data key="value">1</data>
52+
</entity>
53+
<entity name="CashOnDeliveryApplicableAllAllowedCountryConfigData">
54+
<data key="path">payment/cashondelivery/allowspecific</data>
55+
<data key="scope_id">1</data>
56+
<data key="label">All Allowed Countries</data>
57+
<data key="value">0</data>
58+
</entity>
59+
<entity name="CashOnDeliveryAllAllowedCountryConfigData">
60+
<data key="path">payment/cashondelivery/specificcountry</data>
61+
<data key="scope_id">1</data>
62+
<data key="label">All Allowed Countries</data>
63+
<data key="value">''</data>
64+
</entity>
4765
</entities>

0 commit comments

Comments
 (0)