| 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 ShippingAddress { | 10 struct ShippingAddress { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // Payment method specific JSON string that is built either by the browser or | 36 // Payment method specific JSON string that is built either by the browser or |
| 37 // a payment app, for example Android Pay. Browser ensures that the string can | 37 // a payment app, for example Android Pay. Browser ensures that the string can |
| 38 // be successfully parsed into base::JSONParser. Renderer parses this string | 38 // be successfully parsed into base::JSONParser. Renderer parses this string |
| 39 // via v8::JSON::Parse() and hands off the result to the merchant website. | 39 // via v8::JSON::Parse() and hands off the result to the merchant website. |
| 40 // There's no one format for this object, so richer types cannot be used. A | 40 // There's no one format for this object, so richer types cannot be used. A |
| 41 // simple example: | 41 // simple example: |
| 42 // | 42 // |
| 43 // {"nameOnCard": "Jon Doe", "pan": "4111 1111 1111 1111"} | 43 // {"nameOnCard": "Jon Doe", "pan": "4111 1111 1111 1111"} |
| 44 string stringified_details; | 44 string stringified_details; |
| 45 |
| 46 ShippingAddress? shipping_address; |
| 47 string? shipping_option_id; |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 interface PaymentRequestClient { | 50 interface PaymentRequestClient { |
| 48 OnShippingAddressChange(ShippingAddress address); | 51 OnShippingAddressChange(ShippingAddress address); |
| 49 OnShippingOptionChange(string shipping_option_id); | 52 OnShippingOptionChange(string shipping_option_id); |
| 50 OnPaymentResponse(PaymentResponse response); | 53 OnPaymentResponse(PaymentResponse response); |
| 51 OnError(); | 54 OnError(); |
| 52 OnComplete(); | 55 OnComplete(); |
| 53 }; | 56 }; |
| 54 | 57 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // parses the string via base::JSONParser and passes a part of the JSON | 99 // parses the string via base::JSONParser and passes a part of the JSON |
| 97 // object to the payment app, for example Android Pay. There's no one | 100 // 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 | 101 // format for this object, so richer types cannot be used. A simple |
| 99 // example: | 102 // example: |
| 100 // | 103 // |
| 101 // {"https://android.com/pay": {"gateway": "stripe"}} | 104 // {"https://android.com/pay": {"gateway": "stripe"}} |
| 102 string stringified_data); | 105 string stringified_data); |
| 103 Abort(); | 106 Abort(); |
| 104 Complete(bool success); | 107 Complete(bool success); |
| 105 }; | 108 }; |
| OLD | NEW |