Skip to content

Commit f1addc4

Browse files
committed
ACP2E-1303: Pay later payments showing on the storefront even disabled
1 parent ee62521 commit f1addc4

File tree

3 files changed

+47
-11
lines changed

3 files changed

+47
-11
lines changed

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,29 @@
2222
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
2323
</before>
2424
<after>
25-
26-
<!-- Cleanup Paypal configurations -->
27-
2825
<!-- Log out Admin -->
2926
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
3027
</after>
3128

29+
<!-- Open PayPal Advanced->Frontend Experience->Features configuration -->
3230
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage1"/>
3331
<actionGroup ref="AdminOpenPayPalAdvancedFrontendExperienceFeaturesPageActionGroup" stepKey= "openFeaturesPage1"/>
34-
<see selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect('us')}}" userInput="Venmo" stepKey="seeVenmo"/>
35-
<actionGroup ref="AdminSelectDisableFundingActionGroup" stepKey="selectVenmo"/>
32+
<!-- Venmo option is present in Disable Funding Options multiselect -->
33+
<see selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect('us')}}" userInput="Venmo" stepKey="seeVenmoOption"/>
34+
<!-- Select Venmo option in Disable Funding Options multiselect and save config -->
35+
<actionGroup ref="AdminSelectDisableFundingActionGroup" stepKey="selectVenmoOption"/>
3636
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig1"/>
3737
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
38-
<magentoCLI command="cache:flush" stepKey="cleanCache1"/>
39-
4038

39+
<!-- Open PayPal Advanced->Frontend Experience->Features configuration page again -->
4140
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage2"/>
4241
<actionGroup ref="AdminOpenPayPalAdvancedFrontendExperienceFeaturesPageActionGroup" stepKey="openFeaturesPage2"/>
43-
<see selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect('us')}}" userInput="Venmo" stepKey="seeVenmo2"/>
42+
<!-- Check Venmo option is selected -->
4443
<seeOptionIsSelected selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect('us')}}" userInput="Venmo" stepKey="seeVenmoIsSelected"/>
45-
46-
<actionGroup ref="AdminUnselectDisableFundingActionGroup" stepKey="unselectVenmo"/>
44+
<!-- Unselect Venmo option in Disable Funding Options multiselect and save config -->
45+
<actionGroup ref="AdminUnselectDisableFundingActionGroup" stepKey="unselectVenmoOption"/>
4746
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig2"/>
4847
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage2"/>
49-
<magentoCLI command="cache:flush" stepKey="cleanCache2"/>
5048

5149
</test>
5250
</tests>

app/code/Magento/Paypal/Test/Unit/Model/SdkUrlTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ private function getDisallowedFundingMap()
144144
{
145145
return [
146146
"CREDIT" => 'credit',
147+
"VENMO" => 'venmo',
147148
"CARD" => 'card',
148149
"ELV" => 'sepa'
149150
];

app/code/Magento/Paypal/Test/Unit/Model/_files/expected_url_config.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,41 @@ function generateExpectedPaypalSdkUrl(array $params) : String
214214
)
215215
]
216216
],
217+
'venmo_disabled' => [
218+
'en_US',
219+
'Authorization',
220+
'CREDIT,VENMO,ELV,CARD',
221+
false,
222+
true,
223+
[
224+
'sdkUrl' => generateExpectedPaypalSdkUrl(
225+
[
226+
'client-id' => 'sb',
227+
'locale' => 'en_US',
228+
'currency' => 'USD',
229+
'enable-funding' => implode(',', ['venmo', 'paylater']),
230+
'commit' => 'false',
231+
'intent' => 'authorize',
232+
'merchant-id' => 'merchant',
233+
'disable-funding' => implode(
234+
',',
235+
[
236+
'credit',
237+
'venmo',
238+
'sepa',
239+
'card',
240+
'bancontact',
241+
'eps',
242+
'giropay',
243+
'ideal',
244+
'mybank',
245+
'p24',
246+
'sofort'
247+
]
248+
),
249+
'components' => implode(',', ['messages', 'buttons']),
250+
]
251+
)
252+
]
253+
],
217254
];

0 commit comments

Comments
 (0)