Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: ios/chrome/browser/ui/payments/payment_request_coordinator.mm

Issue 2842463002: [Payments] Normalize billing address for response on Desktop. (Closed)
Patch Set: Addressed moe's comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/payments/core/payment_request_data_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/payments/payment_request_coordinator.mm
diff --git a/ios/chrome/browser/ui/payments/payment_request_coordinator.mm b/ios/chrome/browser/ui/payments/payment_request_coordinator.mm
index f0e9e6d6f8b7d94acc91ed0a1c017eb57f0f314a..68fb049eeeebcfc84a9b3a85841c38baa8bcec04 100644
--- a/ios/chrome/browser/ui/payments/payment_request_coordinator.mm
+++ b/ios/chrome/browser/ui/payments/payment_request_coordinator.mm
@@ -220,8 +220,23 @@ class FullCardRequester
? base::ASCIIToUTF16("basic-card")
: base::ASCIIToUTF16(basic_card_type);
+ // Get the billing address
+ autofill::AutofillProfile billingAddress;
+
+ // TODO(crbug.com/714768): Make sure the billing address is set and valid
+ // before getting here. Once the bug is addressed, there will be no need to
+ // copy the address, *billing_address_ptr can be used to get the basic card
+ // response.
+ if (!card.billing_address_id().empty()) {
+ autofill::AutofillProfile* billingAddressPtr =
+ autofill::PersonalDataManager::GetProfileFromProfilesByGUID(
+ card.billing_address_id(), _paymentRequest->billing_profiles());
+ if (billingAddressPtr)
+ billingAddress = *billingAddressPtr;
+ }
+
paymentResponse.details = GetBasicCardResponseFromAutofillCreditCard(
- card, cvc, _paymentRequest->billing_profiles(),
+ card, cvc, billingAddress,
GetApplicationContext()->GetApplicationLocale());
if (_paymentRequest->request_shipping()) {
« no previous file with comments | « components/payments/core/payment_request_data_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698