| 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 module payments.mojom; | 5 module payments.mojom; |
| 6 | 6 |
| 7 import "mojo/common/time.mojom"; | 7 import "mojo/common/time.mojom"; |
| 8 import "third_party/WebKit/public/platform/modules/payments/payment_request.mojo
m"; | 8 import "third_party/WebKit/public/platform/modules/payments/payment_request.mojo
m"; |
| 9 import "url/mojo/url.mojom"; | 9 import "url/mojo/url.mojom"; |
| 10 | 10 |
| 11 enum PaymentHandlerStatus { | 11 enum PaymentHandlerStatus { |
| 12 SUCCESS, | 12 SUCCESS, |
| 13 NOT_IMPLEMENTED, | 13 NOT_IMPLEMENTED, |
| 14 NOT_FOUND, | 14 NOT_FOUND, |
| 15 NO_ACTIVE_WORKER, | 15 NO_ACTIVE_WORKER, |
| 16 STORAGE_OPERATION_FAILED, | 16 STORAGE_OPERATION_FAILED, |
| 17 FETCH_INSTRUMENT_ICON_FAILED, | 17 FETCH_INSTRUMENT_ICON_FAILED, |
| 18 FETCH_PAYMENT_APP_INFO_FAILED, |
| 18 }; | 19 }; |
| 19 | 20 |
| 20 // This struct is provided to hold an image object from render side | 21 // This struct is provided to hold an image object from render side |
| 21 // (ImageObject.idl). | 22 // (ImageObject.idl). |
| 22 struct ImageObject { | 23 struct ImageObject { |
| 23 url.mojom.Url src; | 24 url.mojom.Url src; |
| 24 }; | 25 }; |
| 25 | 26 |
| 26 // This struct is provided to hold a payment instrument from render | 27 // This struct is provided to hold a payment instrument from render |
| 27 // side (PaymentInstrument.idl). | 28 // side (PaymentInstrument.idl). |
| 28 struct PaymentInstrument { | 29 struct PaymentInstrument { |
| 29 string name; | 30 string name; |
| 30 array<ImageObject> icons; | 31 array<ImageObject> icons; |
| 31 array<string> enabled_methods; | 32 array<string> enabled_methods; |
| 32 string stringified_capabilities; | 33 string stringified_capabilities; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 // This interface provides implementation of PaymentInstruments.idl | 36 // This interface provides implementation of PaymentInstruments.idl |
| 36 // in render side. | 37 // in render side. |
| 37 interface PaymentManager { | 38 interface PaymentManager { |
| 38 Init(string service_worker_scope); | 39 Init(string service_worker_script_url, string service_worker_scope); |
| 39 DeletePaymentInstrument(string instrument_key) | 40 DeletePaymentInstrument(string instrument_key) |
| 40 => (PaymentHandlerStatus status); | 41 => (PaymentHandlerStatus status); |
| 41 GetPaymentInstrument(string instrument_key) | 42 GetPaymentInstrument(string instrument_key) |
| 42 => (PaymentInstrument instrument, PaymentHandlerStatus status); | 43 => (PaymentInstrument instrument, PaymentHandlerStatus status); |
| 43 KeysOfPaymentInstruments() | 44 KeysOfPaymentInstruments() |
| 44 => (array<string> keys, PaymentHandlerStatus status); | 45 => (array<string> keys, PaymentHandlerStatus status); |
| 45 HasPaymentInstrument(string instrument_key) | 46 HasPaymentInstrument(string instrument_key) |
| 46 => (PaymentHandlerStatus status); | 47 => (PaymentHandlerStatus status); |
| 47 SetPaymentInstrument(string instrument_key, PaymentInstrument instrument) | 48 SetPaymentInstrument(string instrument_key, PaymentInstrument instrument) |
| 48 => (PaymentHandlerStatus status); | 49 => (PaymentHandlerStatus status); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 68 string method_name; | 69 string method_name; |
| 69 string stringified_details; | 70 string stringified_details; |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 // This interface is provided to pass a payment app response from payment | 73 // This interface is provided to pass a payment app response from payment |
| 73 // request event in renderer side to browser side by calling respondWith(). | 74 // request event in renderer side to browser side by calling respondWith(). |
| 74 interface PaymentAppResponseCallback { | 75 interface PaymentAppResponseCallback { |
| 75 OnPaymentAppResponse(PaymentAppResponse response, | 76 OnPaymentAppResponse(PaymentAppResponse response, |
| 76 mojo.common.mojom.Time dispatch_event_time); | 77 mojo.common.mojom.Time dispatch_event_time); |
| 77 }; | 78 }; |
| OLD | NEW |