Skip to content

Commit 1ee5567

Browse files
committed
AC-1229: PayPal Add Venmo and changed button style to vertical
1 parent 192b280 commit 1ee5567

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ class SdkUrl
5555
*/
5656
private $unsupportedPaymentMethods;
5757

58+
/**
59+
* These payment methods will be added as parameters to the SDK url to enable them.
60+
*
61+
* @var array
62+
*/
63+
private $supportedPaymentMethods;
64+
5865
/**
5966
* @var ResolverInterface
6067
*/
@@ -74,14 +81,16 @@ class SdkUrl
7481
* @param StoreManagerInterface $storeManager
7582
* @param array $disallowedFundingMap
7683
* @param array $unsupportedPaymentMethods
84+
* @param array $supportedPaymentMethods
7785
*/
7886
public function __construct(
7987
ResolverInterface $localeResolver,
8088
ConfigFactory $configFactory,
8189
ScopeConfigInterface $scopeConfig,
8290
StoreManagerInterface $storeManager,
8391
$disallowedFundingMap = [],
84-
$unsupportedPaymentMethods = []
92+
$unsupportedPaymentMethods = [],
93+
$supportedPaymentMethods = []
8594
) {
8695
$this->localeResolver = $localeResolver;
8796
$this->config = $configFactory->create();
@@ -90,6 +99,7 @@ public function __construct(
9099
$this->storeManager = $storeManager;
91100
$this->disallowedFundingMap = $disallowedFundingMap;
92101
$this->unsupportedPaymentMethods = $unsupportedPaymentMethods;
102+
$this->supportedPaymentMethods = $supportedPaymentMethods;
93103
}
94104

95105
/**
@@ -116,6 +126,7 @@ public function getUrl(): string
116126
$params['intent'] = $this->getIntent();
117127
$params['merchant-id'] = $this->config->getValue('merchant_id');
118128
$params['disable-funding'] = $this->getDisallowedFunding();
129+
$params['enable-funding'] = $this->getAllowedFunding();
119130
$params = array_replace($params, $this->queryParams);
120131
}
121132
$params['components'] = implode(',', $components);
@@ -198,6 +209,16 @@ private function getDisallowedFunding()
198209
return implode(',', $result);
199210
}
200211

212+
/**
213+
* Returns allowed funding from configuration
214+
*
215+
* @return string
216+
*/
217+
private function getAllowedFunding()
218+
{
219+
return implode(',', $this->supportedPaymentMethods);
220+
}
221+
201222
/**
202223
* Returns if is allowed PayPal Guest Checkout.
203224
*

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
<item name="label" xsi:type="string">paypal</item>
152152
</item>
153153
<item name="product" xsi:type="array">
154-
<item name="layout" xsi:type="string">horizontal</item>
154+
<item name="layout" xsi:type="string">vertical</item>
155155
<item name="size" xsi:type="string">responsive</item>
156156
<item name="color" xsi:type="string">gold</item>
157157
<item name="shape" xsi:type="string">pill</item>
@@ -177,7 +177,6 @@
177177
<item name="ELV" xsi:type="string">sepa</item>
178178
</argument>
179179
<argument name="unsupportedPaymentMethods" xsi:type="array">
180-
<item name="venmo" xsi:type="string">venmo</item>
181180
<item name="bancontact" xsi:type="string">bancontact</item>
182181
<item name="eps" xsi:type="string">eps</item>
183182
<item name="giropay" xsi:type="string">giropay</item>
@@ -186,6 +185,9 @@
186185
<item name="p24" xsi:type="string">p24</item>
187186
<item name="sofort" xsi:type="string">sofort</item>
188187
</argument>
188+
<argument name="supportedPaymentMethods" xsi:type="array">
189+
<item name="venmo" xsi:type="string">venmo</item>
190+
</argument>
189191
<argument name="localeResolver" xsi:type="object">Magento\Paypal\Model\Express\LocaleResolver</argument>
190192
</arguments>
191193
</type>

0 commit comments

Comments
 (0)