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

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

Issue 2956453003: [Payment Request] Makes sure only complete credit cards can be selected (Closed)
Patch Set: Fixed unit test Created 3 years, 6 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
Index: ios/chrome/browser/ui/payments/payment_request_manager.mm
diff --git a/ios/chrome/browser/ui/payments/payment_request_manager.mm b/ios/chrome/browser/ui/payments/payment_request_manager.mm
index 005f6e625562e06813b3edf6eeb8bcaeccfa841a..2ae43be1f06e0516cd75030d662677d0965c4324 100644
--- a/ios/chrome/browser/ui/payments/payment_request_manager.mm
+++ b/ios/chrome/browser/ui/payments/payment_request_manager.mm
@@ -660,20 +660,14 @@ struct PendingPaymentResponse {
_pendingPaymentResponse.creditCard = card;
_pendingPaymentResponse.verificationCode = verificationCode;
- // 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) {
- _pendingPaymentResponse.billingAddress = *billingAddressPtr;
- _addressNormalizationManager->StartNormalizingAddress(
- &_pendingPaymentResponse.billingAddress);
- }
- }
+ DCHECK(!card.billing_address_id().empty());
+ autofill::AutofillProfile* billingAddress =
+ autofill::PersonalDataManager::GetProfileFromProfilesByGUID(
+ card.billing_address_id(), _paymentRequest->billing_profiles());
+ DCHECK(billingAddress);
+ _pendingPaymentResponse.billingAddress = *billingAddress;
+ _addressNormalizationManager->StartNormalizingAddress(
+ &_pendingPaymentResponse.billingAddress);
if (_paymentRequest->request_shipping()) {
// TODO(crbug.com/602666): User should get here only if they have selected

Powered by Google App Engine
This is Rietveld 408576698