Skip to content

Commit 57384ab

Browse files
author
torreytsui
committed
Generalise address perference unsetting
1 parent 41217be commit 57384ab

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

app/code/Magento/Braintree/Model/Paypal/Helper/QuoteUpdater.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ private function updateShippingAddress(Quote $quote, array $details)
130130
$shippingAddress->setCollectShippingRates(true);
131131

132132
$this->updateAddressData($shippingAddress, $details['shippingAddress']);
133-
134-
// PayPal's address supposes not saving against customer account
135-
$shippingAddress->setSaveInAddressBook(false);
136-
$shippingAddress->setSameAsBilling(false);
137-
$shippingAddress->unsCustomerAddressId();
138133
}
139134

140135
/**
@@ -157,11 +152,6 @@ private function updateBillingAddress(Quote $quote, array $details)
157152
$billingAddress->setFirstname($details['firstName']);
158153
$billingAddress->setLastname($details['lastName']);
159154
$billingAddress->setEmail($details['email']);
160-
161-
// PayPal's address supposes not saving against customer account
162-
$billingAddress->setSaveInAddressBook(false);
163-
$billingAddress->setSameAsBilling(false);
164-
$billingAddress->unsCustomerAddressId();
165155
}
166156

167157
/**
@@ -182,5 +172,10 @@ private function updateAddressData(Address $address, array $addressData)
182172
$address->setRegionCode($addressData['region']);
183173
$address->setCountryId($addressData['countryCodeAlpha2']);
184174
$address->setPostcode($addressData['postalCode']);
175+
176+
// PayPal's address supposes not saving against customer account
177+
$address->setSaveInAddressBook(false);
178+
$address->setSameAsBilling(false);
179+
$address->unsCustomerAddressId();
185180
}
186181
}

0 commit comments

Comments
 (0)