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

Unified Diff: components/payments/content/payment_request_state.cc

Issue 2779813003: [Payments] Add Ship. Addr. & Contact Info in Payment Response on Desktop. (Closed)
Patch Set: 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: components/payments/content/payment_request_state.cc
diff --git a/components/payments/content/payment_request_state.cc b/components/payments/content/payment_request_state.cc
index 47fe27f1539d65424b442caf421c0ae5f2ff5ab0..55dccf190329ba19eeed252584a6a22cec3f8afc 100644
--- a/components/payments/content/payment_request_state.cc
+++ b/components/payments/content/payment_request_state.cc
@@ -11,6 +11,7 @@
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/payments/content/payment_request_spec.h"
+#include "components/payments/content/payment_response_helper.h"
#include "components/payments/core/autofill_payment_instrument.h"
namespace payments {
@@ -70,13 +71,21 @@ void PaymentRequestState::OnInstrumentDetailsReady(
? kBasicCardMethodName
: method_name;
payment_response->stringified_details = stringified_details;
+
+ // Shipping Address section
+ if (spec_->request_shipping()) {
+ payment_response->shipping_address =
+ PaymentResponseHelper::GetMojomPaymentAddressFromAutofillProfile(
+ selected_shipping_profile_, app_locale_);
+ }
+
delegate_->OnPaymentResponseAvailable(std::move(payment_response));
}
void PaymentRequestState::GeneratePaymentResponse() {
DCHECK(is_ready_to_pay());
// Fetch the instrument details, will call back into
- // PaymentRequest::OnInstrumentsDetailsReady.
+ // PaymentRequest::OnInstrumentDetailsReady.
selected_instrument_->InvokePaymentApp(this);
}

Powered by Google App Engine
This is Rietveld 408576698