diff --git a/app/code/Magento/Braintree/Model/Paypal/Helper/QuoteUpdater.php b/app/code/Magento/Braintree/Model/Paypal/Helper/QuoteUpdater.php index 56ac9a604fe9b..cfe99192d90e5 100644 --- a/app/code/Magento/Braintree/Model/Paypal/Helper/QuoteUpdater.php +++ b/app/code/Magento/Braintree/Model/Paypal/Helper/QuoteUpdater.php @@ -84,6 +84,14 @@ private function updateQuote(Quote $quote, array $details) $quote->collectTotals(); + /** + * Unset shipping assignment to prevent from saving / applying outdated data + * @see \Magento\Quote\Model\QuoteRepository\SaveHandler::processShippingAssignment + */ + if ($quote->getExtensionAttributes()) { + $quote->getExtensionAttributes()->setShippingAssignments(null); + } + $this->quoteRepository->save($quote); } @@ -164,5 +172,10 @@ private function updateAddressData(Address $address, array $addressData) $address->setRegionCode($addressData['region']); $address->setCountryId($addressData['countryCodeAlpha2']); $address->setPostcode($addressData['postalCode']); + + // PayPal's address supposes not saving against customer account + $address->setSaveInAddressBook(false); + $address->setSameAsBilling(false); + $address->setCustomerAddressId(null); } }