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 "components/payments/mojom/payment_request.mojom"; | 7 import "components/payments/mojom/payment_request.mojom"; |
8 import "mojo/common/time.mojom"; | 8 import "mojo/common/time.mojom"; |
9 import "url/mojo/url.mojom"; | 9 import "url/mojo/url.mojom"; |
10 | 10 |
11 enum PaymentAppManifestError { | |
12 NONE, | |
13 NOT_IMPLEMENTED, | |
14 NO_ACTIVE_WORKER, | |
15 MANIFEST_STORAGE_OPERATION_FAILED, | |
16 }; | |
17 | |
18 struct PaymentAppOption { | |
19 string name; | |
20 string? icon; | |
21 string id; | |
22 array<string> enabled_methods; | |
23 }; | |
24 | |
25 struct PaymentAppManifest { | |
26 string name; | |
27 string? icon; | |
28 array<PaymentAppOption> options; | |
29 }; | |
30 | |
31 enum PaymentHandlerStatus { | 11 enum PaymentHandlerStatus { |
32 SUCCESS, | 12 SUCCESS, |
33 NOT_IMPLEMENTED, | 13 NOT_IMPLEMENTED, |
34 NOT_FOUND, | 14 NOT_FOUND, |
35 NO_ACTIVE_WORKER, | 15 NO_ACTIVE_WORKER, |
36 STORAGE_OPERATION_FAILED, | 16 STORAGE_OPERATION_FAILED, |
37 }; | 17 }; |
38 | 18 |
39 struct PaymentInstrument { | 19 struct PaymentInstrument { |
40 string name; | 20 string name; |
41 array<string> enabled_methods; | 21 array<string> enabled_methods; |
42 string stringified_capabilities; | 22 string stringified_capabilities; |
43 }; | 23 }; |
44 | 24 |
45 interface PaymentManager { | 25 interface PaymentManager { |
46 Init(string service_worker_scope); | 26 Init(string service_worker_scope); |
47 SetManifest(PaymentAppManifest payment_app_manifest) | |
48 => (PaymentAppManifestError error); | |
49 GetManifest() | |
50 => (PaymentAppManifest payment_app_manifest, PaymentAppManifestError error
); | |
51 DeletePaymentInstrument(string instrument_key) | 27 DeletePaymentInstrument(string instrument_key) |
52 => (PaymentHandlerStatus status); | 28 => (PaymentHandlerStatus status); |
53 GetPaymentInstrument(string instrument_key) | 29 GetPaymentInstrument(string instrument_key) |
54 => (PaymentInstrument instrument, PaymentHandlerStatus status); | 30 => (PaymentInstrument instrument, PaymentHandlerStatus status); |
55 KeysOfPaymentInstruments() | 31 KeysOfPaymentInstruments() |
56 => (array<string> keys, PaymentHandlerStatus status); | 32 => (array<string> keys, PaymentHandlerStatus status); |
57 HasPaymentInstrument(string instrument_key) | 33 HasPaymentInstrument(string instrument_key) |
58 => (PaymentHandlerStatus status); | 34 => (PaymentHandlerStatus status); |
59 SetPaymentInstrument(string instrument_key, PaymentInstrument instrument) | 35 SetPaymentInstrument(string instrument_key, PaymentInstrument instrument) |
60 => (PaymentHandlerStatus status); | 36 => (PaymentHandlerStatus status); |
(...skipping 15 matching lines...) Expand all Loading... |
76 string method_name; | 52 string method_name; |
77 string stringified_details; | 53 string stringified_details; |
78 }; | 54 }; |
79 | 55 |
80 // This interface is provided to pass a payment app response from payment | 56 // This interface is provided to pass a payment app response from payment |
81 // request event in renderer side to browser side by calling respondWith(). | 57 // request event in renderer side to browser side by calling respondWith(). |
82 interface PaymentAppResponseCallback { | 58 interface PaymentAppResponseCallback { |
83 OnPaymentAppResponse(PaymentAppResponse response, | 59 OnPaymentAppResponse(PaymentAppResponse response, |
84 mojo.common.mojom.Time dispatch_event_time); | 60 mojo.common.mojom.Time dispatch_event_time); |
85 }; | 61 }; |
OLD | NEW |