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

Unified Diff: components/payments/payment_request.mojom

Issue 2500183002: Do not parse JSON in the browser. (Closed)
Patch Set: Use a Dictionary type in IDL Created 4 years, 1 month 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/payment_request.mojom
diff --git a/components/payments/payment_request.mojom b/components/payments/payment_request.mojom
index 5820909d98b46c5c7153410b8d685e226a1314fc..1e8bc5c307052972c4038ca2fff5a4ff4e6e2323 100644
--- a/components/payments/payment_request.mojom
+++ b/components/payments/payment_request.mojom
@@ -127,18 +127,51 @@ struct PaymentOptions {
PaymentShippingType shipping_type;
};
+enum AndroidPayEnvironment {
+ PRODUCTION,
+ TEST
+};
+
+enum AndroidPayCardNetwork {
+ AMEX,
+ DISCOVER,
+ MASTERCARD,
+ VISA
+};
+
+enum AndroidPayTokenization {
+ UNSPECIFIED,
+ GATEWAY_TOKEN,
+ NETWORK_TOKEN
+};
+
+struct AndroidPayTokenizationParameter {
+ string? key;
+ string? value;
+};
+
struct PaymentMethodData {
array<string> supported_methods;
+
// A JSON string built by the renderer from a JavaScript object that the
// merchant website provides. The renderer uses
- // blink::JSONObject::toJSONString() to generate this string. The browser
- // parses the string via JSONObject(JsonSanitizer.sanitize(stringified_data))
- // and passes a part of the JSON object to the payment app, for example
- // Android Pay. There's no one format for this object, so richer types cannot
- // be used. A simple example:
+ // blink::JSONObject::toJSONString() to generate this string. The browser does
+ // not parse the string and passes it as-is directly to payment apps. There's
+ // no one format for this object, so richer types cannot be used. A simple
+ // example:
//
// {"gateway": "stripe"}
string stringified_data;
+
+ // Android Pay specific method data is parsed in the renderer.
+ // https://developers.google.com/web/fundamentals/getting-started/primers/payment-request/android-pay
+ // TODO(rouslan): Stop parsing Android Pay data. http://crbug.com/620173
+ AndroidPayEnvironment environment;
+ string? merchant_name;
+ string? merchant_id;
+ array<AndroidPayCardNetwork> allowed_card_networks;
+ AndroidPayTokenization tokenization_type;
+ array<AndroidPayTokenizationParameter> parameters;
};
enum PaymentComplete {

Powered by Google App Engine
This is Rietveld 408576698