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

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

Issue 2733953003: [Payments] Return a basic card response (Closed)
Patch Set: addressed comments from anthony Created 3 years, 9 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_coordinator.mm
diff --git a/ios/chrome/browser/payments/payment_request_coordinator.mm b/ios/chrome/browser/payments/payment_request_coordinator.mm
index 6db03c9d0f7f4d81441ea24d32605703469c7aee..7c584cba9c6a3cd7c11287e1b19f00c306b1e08e 100644
--- a/ios/chrome/browser/payments/payment_request_coordinator.mm
+++ b/ios/chrome/browser/payments/payment_request_coordinator.mm
@@ -19,6 +19,8 @@
#include "components/autofill/core/browser/payments/full_card_request.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.h"
+#include "components/payments/core/payment_address.h"
+#include "components/payments/core/payment_request_data_util.h"
#include "components/strings/grit/components_strings.h"
#include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
@@ -32,8 +34,8 @@
#endif
namespace {
-using ::payment_request_util::GetBasicCardResponseFromAutofillCreditCard;
-using ::payment_request_util::GetPaymentAddressFromAutofillProfile;
+using ::payments::data_util::GetBasicCardResponseFromAutofillCreditCard;
+using ::payments::data_util::GetPaymentAddressFromAutofillProfile;
} // namespace
// The unmask prompt UI for Payment Request.
@@ -195,8 +197,9 @@ class FullCardRequester
base::ASCIIToUTF16(autofill::data_util::GetPaymentRequestData(card.type())
.basic_card_payment_type);
- paymentResponse.details =
- GetBasicCardResponseFromAutofillCreditCard(*_paymentRequest, card, cvc);
+ paymentResponse.details = GetBasicCardResponseFromAutofillCreditCard(
+ card, cvc, _paymentRequest->billing_profiles(),
+ GetApplicationContext()->GetApplicationLocale());
if (_paymentRequest->payment_options().request_shipping) {
autofill::AutofillProfile* shippingAddress =
@@ -204,8 +207,8 @@ class FullCardRequester
// TODO(crbug.com/602666): User should get here only if they have selected
// a shipping address.
DCHECK(shippingAddress);
- paymentResponse.shipping_address =
- GetPaymentAddressFromAutofillProfile(*shippingAddress);
+ paymentResponse.shipping_address = GetPaymentAddressFromAutofillProfile(
+ *shippingAddress, GetApplicationContext()->GetApplicationLocale());
web::PaymentShippingOption* shippingOption =
_paymentRequest->selected_shipping_option();
@@ -396,8 +399,8 @@ class FullCardRequester
(autofill::AutofillProfile*)shippingAddress {
_pendingShippingAddress = shippingAddress;
DCHECK(shippingAddress);
- web::PaymentAddress address =
- GetPaymentAddressFromAutofillProfile(*shippingAddress);
+ payments::PaymentAddress address = GetPaymentAddressFromAutofillProfile(
+ *shippingAddress, GetApplicationContext()->GetApplicationLocale());
[_delegate paymentRequestCoordinator:self didSelectShippingAddress:address];
}

Powered by Google App Engine
This is Rietveld 408576698