Skip to content

Commit 4d5d63c

Browse files
committed
AC-1230: PayPal Add PayLater and made PayLater option availale for all countries
1 parent 6c2699e commit 4d5d63c

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,21 @@ private function getDisallowedFunding()
206206
}
207207

208208
/**
209-
* Returns allowed funding from configuration
209+
* Returns allowed funding from configuration after validating
210210
*
211211
* @return string
212212
*/
213213
private function getAllowedFunding()
214214
{
215-
return implode(',', $this->supportedPaymentMethods);
215+
$payLaterActive = (boolean)$this->config->getPayLaterConfigValue('experience_active');
216+
217+
// If Pay Later is enabled, then only paylater parameter will go in enable-funding parameter list
218+
if ($payLaterActive == false) {
219+
unset($this->supportedPaymentMethods['paylater']);
220+
return implode(',', $this->supportedPaymentMethods);
221+
} else {
222+
return implode(',', $this->supportedPaymentMethods);
223+
}
216224
}
217225

218226
/**

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@
247247
<group id="express_checkout_required">
248248
<field id="enable_express_checkout_bml" showInDefault="0" showInWebsite="0"/>
249249
<field id="express_checkout_bml_sort_order" showInDefault="0" showInWebsite="0"/>
250-
<field id="enable_paypal_paylater_experience" showInDefault="0" showInWebsite="0"/>
250+
<field id="enable_paypal_paylater_experience" showInDefault="1" showInWebsite="1"/>
251251
<group id="advertise_bml" showInDefault="0" showInWebsite="0"/>
252-
<group id="advertise_paylater" showInDefault="0" showInWebsite="0"/>
252+
<group id="advertise_paylater" showInDefault="1" showInWebsite="1"/>
253253
</group>
254254
</group>
255255
<group id="paypal_group_all_in_one" translate="label comment" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="1">
@@ -279,9 +279,9 @@
279279
</field>
280280
<field id="enable_express_checkout_bml" showInDefault="0" showInWebsite="0"/>
281281
<field id="express_checkout_bml_sort_order" showInDefault="0" showInWebsite="0"/>
282-
<field id="enable_paypal_paylater_experience" showInDefault="0" showInWebsite="0"/>
282+
<field id="enable_paypal_paylater_experience" showInDefault="1" showInWebsite="1"/>
283283
<group id="advertise_bml" showInDefault="0" showInWebsite="0"/>
284-
<group id="advertise_paylater" showInDefault="0" showInWebsite="0"/>
284+
<group id="advertise_paylater" showInDefault="1" showInWebsite="1"/>
285285
</group>
286286
<group id="settings_ec">
287287
<label>Basic Settings - PayPal Website Payments Standard</label>

app/code/Magento/Paypal/etc/frontend/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@
187187
</argument>
188188
<argument name="supportedPaymentMethods" xsi:type="array">
189189
<item name="venmo" xsi:type="string">venmo</item>
190+
<item name="paylater" xsi:type="string">paylater</item>
190191
</argument>
191192
<argument name="localeResolver" xsi:type="object">Magento\Paypal\Model\Express\LocaleResolver</argument>
192193
</arguments>

0 commit comments

Comments
 (0)