File tree Expand file tree Collapse file tree 3 files changed +34
-21
lines changed Expand file tree Collapse file tree 3 files changed +34
-21
lines changed Original file line number Diff line number Diff line change @@ -607,25 +607,6 @@ class Config extends AbstractConfig
607
607
*/
608
608
protected $ cspNonceProvider ;
609
609
610
- /**
611
- * Payment methods to skip address validation
612
- */
613
- public const PAYMENT_METHODS_SKIP_ADDRESS_VALIDATION = [
614
- self ::METHOD_EXPRESS ,
615
- self ::METHOD_WPS_EXPRESS ,
616
- self ::METHOD_WPS_BML ,
617
- self ::METHOD_WPP_BML ,
618
- self ::METHOD_WPP_DIRECT ,
619
- self ::METHOD_PAYMENT_PRO ,
620
- self ::METHOD_WPP_PE_EXPRESS ,
621
- self ::METHOD_WPP_PE_BML ,
622
- self ::METHOD_PAYFLOWPRO ,
623
- self ::METHOD_PAYFLOWLINK ,
624
- self ::METHOD_PAYFLOWADVANCED ,
625
- self ::METHOD_HOSTEDPRO ,
626
- self ::METHOD_BILLING_AGREEMENT
627
- ];
628
-
629
610
/**
630
611
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
631
612
* @param \Magento\Directory\Helper\Data $directoryHelper
Original file line number Diff line number Diff line change 9
9
10
10
use Magento \Quote \Model \CustomerManagement ;
11
11
use Magento \Quote \Model \Quote as QuoteEntity ;
12
- use Magento \Paypal \Model \Config as PaymentMethodConfig ;
13
12
14
13
/**
15
14
* Skip billing address validation for PayPal payment method
16
15
*/
17
16
class CustomerManagementPlugin
18
17
{
18
+ /**
19
+ * @var array
20
+ */
21
+ private $ paymentMethodSkipAddressValidation ;
22
+
23
+ /**
24
+ * PaymentMethodSkipAddressValidation constructor.
25
+ * @param array $paymentMethodSkipAddressValidation
26
+ */
27
+ public function __construct ($ paymentMethodSkipAddressValidation = [])
28
+ {
29
+ $ this ->paymentMethodSkipAddressValidation = $ paymentMethodSkipAddressValidation ;
30
+ }
31
+
19
32
/**
20
33
* Around plugin for the validateAddresses method
21
34
*
@@ -28,7 +41,7 @@ class CustomerManagementPlugin
28
41
public function aroundValidateAddresses (CustomerManagement $ subject , \Closure $ proceed , QuoteEntity $ quote )
29
42
{
30
43
if ($ quote ->getCustomerIsGuest () &&
31
- in_array ($ quote ->getPayment ()->getMethod (), PaymentMethodConfig:: PAYMENT_METHODS_SKIP_ADDRESS_VALIDATION )) {
44
+ in_array ($ quote ->getPayment ()->getMethod (), $ this -> paymentMethodSkipAddressValidation )) {
32
45
return ;
33
46
}
34
47
$ proceed ($ quote );
Original file line number Diff line number Diff line change 272
272
<type name =" Magento\Quote\Model\CustomerManagement" >
273
273
<plugin name =" paypal_payment_skip_addresses_validate" type =" Magento\Paypal\Plugin\CustomerManagementPlugin" />
274
274
</type >
275
+ <type name =" Magento\Paypal\Plugin\CustomerManagementPlugin" >
276
+ <arguments >
277
+ <argument name =" paymentMethodSkipAddressValidation" xsi : type =" array" >
278
+ <item name =" paypal_express" xsi : type =" string" >paypal_express</item >
279
+ <item name =" wps_express" xsi : type =" string" >wps_express</item >
280
+ <item name =" wps_express_bml" xsi : type =" string" >wps_express_bml</item >
281
+ <item name =" paypal_express_bml" xsi : type =" string" >paypal_express_bml</item >
282
+ <item name =" paypal_direct" xsi : type =" string" >paypal_direct</item >
283
+ <item name =" paypal_payment_pro" xsi : type =" string" >paypal_payment_pro</item >
284
+ <item name =" payflow_express" xsi : type =" string" >payflow_express</item >
285
+ <item name =" payflow_express_bml" xsi : type =" string" >payflow_express_bml</item >
286
+ <item name =" payflowpro" xsi : type =" string" >payflowpro</item >
287
+ <item name =" payflow_link" xsi : type =" string" >payflow_link</item >
288
+ <item name =" payflow_advanced" xsi : type =" string" >payflow_advanced</item >
289
+ <item name =" hosted_pro" xsi : type =" string" >hosted_pro</item >
290
+ <item name =" paypal_billing_agreement" xsi : type =" string" >paypal_billing_agreement</item >
291
+ </argument >
292
+ </arguments >
293
+ </type >
275
294
</config >
You can’t perform that action at this time.
0 commit comments