| 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 PaymentAddress { |
| 11 // ISO 3166 country code. Two upper case ASCII letters. | 11 // ISO 3166 country code. Two upper case ASCII letters. |
| 12 string region_code; | 12 string region_code; |
| 13 | 13 |
| 14 array<string> address_line; | 14 array<string> address_line; |
| 15 string administrative_area; | 15 string administrative_area; |
| 16 string locality; | 16 string locality; |
| 17 string dependent_locality; | 17 string dependent_locality; |
| 18 string postal_code; | 18 string postal_code; |
| 19 string sorting_code; | 19 string sorting_code; |
| 20 | 20 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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 | 45 |
| 46 ShippingAddress? shipping_address; | 46 PaymentAddress? shipping_address; |
| 47 string? shipping_option_id; | 47 string? shipping_option_id; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 interface PaymentRequestClient { | 50 interface PaymentRequestClient { |
| 51 OnShippingAddressChange(ShippingAddress address); | 51 OnShippingAddressChange(PaymentAddress address); |
| 52 OnShippingOptionChange(string shipping_option_id); | 52 OnShippingOptionChange(string shipping_option_id); |
| 53 OnPaymentResponse(PaymentResponse response); | 53 OnPaymentResponse(PaymentResponse response); |
| 54 OnError(); | 54 OnError(); |
| 55 OnComplete(); | 55 OnComplete(); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 // The currency amount that the renderer provides to the browser process. The | 58 // The currency amount that the renderer provides to the browser process. The |
| 59 // browser shows the amount in UI and forwards it on to the payment app, if it | 59 // browser shows the amount in UI and forwards it on to the payment app, if it |
| 60 // requires the amount. | 60 // requires the amount. |
| 61 struct CurrencyAmount { | 61 struct CurrencyAmount { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // object to the payment app, for example Android Pay. There's no one | 99 // object to the payment app, for example Android Pay. There's no one |
| 100 // format for this object, so richer types cannot be used. A simple | 100 // format for this object, so richer types cannot be used. A simple |
| 101 // example: | 101 // example: |
| 102 // | 102 // |
| 103 // {"https://android.com/pay": {"gateway": "stripe"}} | 103 // {"https://android.com/pay": {"gateway": "stripe"}} |
| 104 string stringified_data); | 104 string stringified_data); |
| 105 UpdateWith(PaymentDetails details); | 105 UpdateWith(PaymentDetails details); |
| 106 Abort(); | 106 Abort(); |
| 107 Complete(bool success); | 107 Complete(bool success); |
| 108 }; | 108 }; |
| OLD | NEW |