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

Unified Diff: components/payments/core/autofill_payment_instrument.cc

Issue 2849523003: Add billing address as a mandatory field of Payments credit cards. (Closed)
Patch Set: Components Unittests fix Created 3 years, 7 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: components/payments/core/autofill_payment_instrument.cc
diff --git a/components/payments/core/autofill_payment_instrument.cc b/components/payments/core/autofill_payment_instrument.cc
index d32149a13386f818ca0c9ab8a79591120cca14da..08502b4e832477bd4c4697e276240ca7fa536ee9 100644
--- a/components/payments/core/autofill_payment_instrument.cc
+++ b/components/payments/core/autofill_payment_instrument.cc
@@ -55,8 +55,6 @@ void AutofillPaymentInstrument::InvokePaymentApp(
delegate_ = delegate;
// Get the billing address.
- // TODO(crbug.com/709776): Make sure the billing address is valid before
- // getting here.
if (!credit_card_.billing_address_id().empty()) {
autofill::AutofillProfile* billing_address =
autofill::PersonalDataManager::GetProfileFromProfilesByGUID(
@@ -84,18 +82,21 @@ void AutofillPaymentInstrument::InvokePaymentApp(
}
bool AutofillPaymentInstrument::IsCompleteForPayment() {
- return autofill::GetCompletionStatusForCard(credit_card_, app_locale_) ==
+ return autofill::GetCompletionStatusForCard(credit_card_, app_locale_,
+ billing_profiles_) ==
autofill::CREDIT_CARD_COMPLETE;
}
base::string16 AutofillPaymentInstrument::GetMissingInfoLabel() {
return autofill::GetCompletionMessageForCard(
- autofill::GetCompletionStatusForCard(credit_card_, app_locale_));
+ autofill::GetCompletionStatusForCard(credit_card_, app_locale_,
+ billing_profiles_));
}
bool AutofillPaymentInstrument::IsValidForCanMakePayment() {
autofill::CreditCardCompletionStatus status =
- autofill::GetCompletionStatusForCard(credit_card_, app_locale_);
+ autofill::GetCompletionStatusForCard(credit_card_, app_locale_,
+ billing_profiles_);
// Card has to have a cardholder name and number for the purposes of
// CanMakePayment. An expired card is still valid at this stage.
return !(status & autofill::CREDIT_CARD_NO_CARDHOLDER ||

Powered by Google App Engine
This is Rietveld 408576698