Skip to content

Commit efdda6a

Browse files
committed
AC-13828::Unable to place order with paypal express checkout when we are directly checking out from cart page
1 parent fee5d2e commit efdda6a

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,25 @@ class Config extends AbstractConfig
607607
*/
608608
protected $cspNonceProvider;
609609

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+
610629
/**
611630
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
612631
* @param \Magento\Directory\Helper\Data $directoryHelper

app/code/Magento/Quote/Model/CustomerManagement.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Framework\Validator\Exception as ValidatorException;
1717
use Magento\Framework\Validator\Factory as ValidatorFactory;
1818
use Magento\Quote\Model\Quote as QuoteEntity;
19+
use Magento\Paypal\Model\Config as PaymentMethod;
1920

2021
/**
2122
* Class Customer
@@ -159,7 +160,8 @@ public function validateAddresses(QuoteEntity $quote)
159160
$quote->getShippingAddress()->getCustomerAddressId()
160161
);
161162
}
162-
if (empty($addresses) && $quote->getCustomerIsGuest()) {
163+
if (empty($addresses) && $quote->getCustomerIsGuest() &&
164+
!in_array($quote->getPayment()->getMethod(), PaymentMethod::PAYMENT_METHODS_SKIP_ADDRESS_VALIDATION)) {
163165
$billingAddress = $quote->getBillingAddress();
164166
$customerAddress = $this->customerAddressFactory->create();
165167
$customerAddress->setFirstname($billingAddress->getFirstname());

0 commit comments

Comments
 (0)