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

Unified Diff: ios/chrome/browser/payments/payment_request_util.h

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/payments/payment_request_util.h
diff --git a/ios/chrome/browser/payments/payment_request_util.h b/ios/chrome/browser/payments/payment_request_util.h
index 88fd9ee0b838b508ada0d8f1947f39e3871f82f0..3bbb6d698a533241f8eb09165da45ede6e28cf88 100644
--- a/ios/chrome/browser/payments/payment_request_util.h
+++ b/ios/chrome/browser/payments/payment_request_util.h
@@ -7,11 +7,14 @@
#import <Foundation/Foundation.h>
+#include <vector>
+
#include "base/strings/string16.h"
#include "components/payments/core/payment_options_provider.h"
namespace autofill {
class AutofillProfile;
+class CreditCard;
} // namespace autofill
class PaymentRequest;
@@ -49,6 +52,18 @@ NSString* GetAddressNotificationLabelFromAutofillProfile(
PaymentRequest& payment_request,
const autofill::AutofillProfile& profile);
+// Returns whether the credit card is complete to be used as a payment method
+// without further editing.
+BOOL IsCreditCardCompleteForPayment(
+ const autofill::CreditCard& credit_card,
+ const std::vector<autofill::AutofillProfile*>& billing_profiles);
+
+// Helper function to create a notification label for what's missing from a
+// credit card. Returns nil if the resulting label is empty.
+NSString* GetPaymentMethodNotificationLabelFromCreditCard(
+ const autofill::CreditCard& credit_card,
+ const std::vector<autofill::AutofillProfile*>& billing_profiles);
+
// Returns the title for the shipping section of the payment summary view given
// the shipping type specified in |payment_request|.
NSString* GetShippingSectionTitle(payments::PaymentShippingType shipping_type);
« no previous file with comments | « ios/chrome/browser/payments/payment_request_unittest.mm ('k') | ios/chrome/browser/payments/payment_request_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698