| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/autofill/core/browser/payments/payments_client.h" | 5 #include "components/autofill/core/browser/payments/payments_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 request_dict.SetString("encrypted_pan", "__param:s7e_1_pan"); | 287 request_dict.SetString("encrypted_pan", "__param:s7e_1_pan"); |
| 288 request_dict.SetString("encrypted_cvc", "__param:s7e_13_cvc"); | 288 request_dict.SetString("encrypted_cvc", "__param:s7e_13_cvc"); |
| 289 request_dict.Set("risk_data_encoded", | 289 request_dict.Set("risk_data_encoded", |
| 290 BuildRiskDictionary(request_details_.risk_data)); | 290 BuildRiskDictionary(request_details_.risk_data)); |
| 291 | 291 |
| 292 const std::string& app_locale = request_details_.app_locale; | 292 const std::string& app_locale = request_details_.app_locale; |
| 293 scoped_ptr<base::DictionaryValue> context(new base::DictionaryValue()); | 293 scoped_ptr<base::DictionaryValue> context(new base::DictionaryValue()); |
| 294 context->SetString("language_code", app_locale); | 294 context->SetString("language_code", app_locale); |
| 295 request_dict.Set("context", std::move(context)); | 295 request_dict.Set("context", std::move(context)); |
| 296 | 296 |
| 297 request_dict.SetString("cardholder_name", | 297 request_dict.SetString( |
| 298 request_details_.card.GetInfo( | 298 "cardholder_name", |
| 299 AutofillType(CREDIT_CARD_NAME), app_locale)); | 299 request_details_.card.GetInfo(AutofillType(CREDIT_CARD_NAME_FULL), |
| 300 app_locale)); |
| 300 | 301 |
| 301 scoped_ptr<base::ListValue> addresses(new base::ListValue()); | 302 scoped_ptr<base::ListValue> addresses(new base::ListValue()); |
| 302 for (const AutofillProfile& profile : request_details_.profiles) { | 303 for (const AutofillProfile& profile : request_details_.profiles) { |
| 303 addresses->Append(BuildAddressDictionary(profile, app_locale)); | 304 addresses->Append(BuildAddressDictionary(profile, app_locale)); |
| 304 } | 305 } |
| 305 request_dict.Set("address", std::move(addresses)); | 306 request_dict.Set("address", std::move(addresses)); |
| 306 | 307 |
| 307 request_dict.SetString("context_token", request_details_.context_token); | 308 request_dict.SetString("context_token", request_details_.context_token); |
| 308 | 309 |
| 309 int value = 0; | 310 int value = 0; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 535 |
| 535 void PaymentsClient::SetOAuth2TokenAndStartRequest() { | 536 void PaymentsClient::SetOAuth2TokenAndStartRequest() { |
| 536 url_fetcher_->AddExtraRequestHeader(net::HttpRequestHeaders::kAuthorization + | 537 url_fetcher_->AddExtraRequestHeader(net::HttpRequestHeaders::kAuthorization + |
| 537 std::string(": Bearer ") + access_token_); | 538 std::string(": Bearer ") + access_token_); |
| 538 | 539 |
| 539 url_fetcher_->Start(); | 540 url_fetcher_->Start(); |
| 540 } | 541 } |
| 541 | 542 |
| 542 } // namespace payments | 543 } // namespace payments |
| 543 } // namespace autofill | 544 } // namespace autofill |
| OLD | NEW |