Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 [JavaPackage="org.chromium.mojom.payments"] | 5 [JavaPackage="org.chromium.mojom.payments"] |
| 6 module blink.mojom; | 6 module blink.mojom; |
| 7 | 7 |
| 8 // The shipping address that the browser process provides to the renderer | 8 // The shipping address that the browser process provides to the renderer |
| 9 // process. Built either by the browser or a payment app. | 9 // process. Built either by the browser or a payment app. |
| 10 struct PaymentAddress { | 10 struct PaymentAddress { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 struct PaymentDetails { | 81 struct PaymentDetails { |
| 82 PaymentItem total; | 82 PaymentItem total; |
| 83 array<PaymentItem> display_items; | 83 array<PaymentItem> display_items; |
| 84 array<ShippingOption> shipping_options; | 84 array<ShippingOption> shipping_options; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 struct PaymentOptions { | 87 struct PaymentOptions { |
| 88 bool request_shipping; | 88 bool request_shipping; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 struct PaymentMethodData { | |
| 92 array<string> supported_methods; | |
| 93 // A JSON string built by the renderer from a JavaScript object that the | |
| 94 // merchant website provides. The renderer uses | |
| 95 // blink::JSONObject::toJSONString() to generate this string. The browser | |
| 96 // parses the string via base::JSONParser and passes a part of the JSON | |
|
please use gerrit instead
2016/06/09 02:44:13
Replace "base::JSONParser" with "JSONObject(JsonSa
| |
| 97 // object to the payment app, for example Android Pay. There's no one | |
| 98 // format for this object, so richer types cannot be used. A simple | |
| 99 // example: | |
| 100 // | |
| 101 // {"gateway": "stripe"} | |
| 102 string data; | |
|
please use gerrit instead
2016/06/09 02:44:13
Let's call it "stringified_data" to match WebKit.
| |
| 103 }; | |
| 104 | |
| 91 interface PaymentRequest { | 105 interface PaymentRequest { |
| 92 SetClient(PaymentRequestClient client); | 106 SetClient(PaymentRequestClient client); |
| 93 Show(array<string> supported_methods, | 107 Show(array<PaymentMethodData> methodData, |
| 94 PaymentDetails details, | 108 PaymentDetails details, |
| 95 PaymentOptions options, | 109 PaymentOptions options); |
| 96 // A JSON string built by the renderer from a JavaScript object that the | |
| 97 // merchant website provides. The renderer uses | |
| 98 // blink::JSONObject::toJSONString() to generate this string. The browser | |
| 99 // parses the string via base::JSONParser and passes a part of the JSON | |
| 100 // object to the payment app, for example Android Pay. There's no one | |
| 101 // format for this object, so richer types cannot be used. A simple | |
| 102 // example: | |
| 103 // | |
| 104 // {"https://android.com/pay": {"gateway": "stripe"}} | |
| 105 string stringified_data); | |
| 106 UpdateWith(PaymentDetails details); | 110 UpdateWith(PaymentDetails details); |
| 107 Abort(); | 111 Abort(); |
| 108 Complete(bool success); | 112 Complete(bool success); |
| 109 }; | 113 }; |
| OLD | NEW |