File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -607,6 +607,25 @@ 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
+
610
629
/**
611
630
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
612
631
* @param \Magento\Directory\Helper\Data $directoryHelper
Original file line number Diff line number Diff line change 16
16
use Magento \Framework \Validator \Exception as ValidatorException ;
17
17
use Magento \Framework \Validator \Factory as ValidatorFactory ;
18
18
use Magento \Quote \Model \Quote as QuoteEntity ;
19
+ use Magento \Paypal \Model \Config as PaymentMethod ;
19
20
20
21
/**
21
22
* Class Customer
@@ -159,7 +160,8 @@ public function validateAddresses(QuoteEntity $quote)
159
160
$ quote ->getShippingAddress ()->getCustomerAddressId ()
160
161
);
161
162
}
162
- if (empty ($ addresses ) && $ quote ->getCustomerIsGuest ()) {
163
+ if (empty ($ addresses ) && $ quote ->getCustomerIsGuest () &&
164
+ !in_array ($ quote ->getPayment ()->getMethod (), PaymentMethod::PAYMENT_METHODS_SKIP_ADDRESS_VALIDATION )) {
163
165
$ billingAddress = $ quote ->getBillingAddress ();
164
166
$ customerAddress = $ this ->customerAddressFactory ->create ();
165
167
$ customerAddress ->setFirstname ($ billingAddress ->getFirstname ());
You can’t perform that action at this time.
0 commit comments