-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
payment-handler.idl
96 lines (83 loc) · 3.1 KB
/
payment-handler.idl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports)
// Source: Payment Handler API (https://w3c.github.io/payment-handler/)
partial interface ServiceWorkerRegistration {
[SameObject] readonly attribute PaymentManager paymentManager;
};
[SecureContext, Exposed=(Window,Worker)]
interface PaymentManager {
[SameObject] readonly attribute PaymentInstruments instruments;
attribute DOMString userHint;
};
[SecureContext, Exposed=(Window,Worker)]
interface PaymentInstruments {
Promise<boolean> delete(DOMString instrumentKey);
Promise<any> get(DOMString instrumentKey);
Promise<sequence<DOMString>> keys();
Promise<boolean> has(DOMString instrumentKey);
Promise<void> set(DOMString instrumentKey, PaymentInstrument details);
Promise<void> clear();
};
dictionary PaymentInstrument {
required DOMString name;
sequence<ImageObject> icons;
DOMString method;
object capabilities;
};
dictionary ImageObject {
required USVString src;
DOMString sizes;
DOMString type;
};
partial interface ServiceWorkerGlobalScope {
attribute EventHandler oncanmakepayment;
};
[Constructor(DOMString type, CanMakePaymentEventInit eventInitDict), Exposed=ServiceWorker]
interface CanMakePaymentEvent : ExtendableEvent {
readonly attribute USVString topOrigin;
readonly attribute USVString paymentRequestOrigin;
readonly attribute FrozenArray<PaymentMethodData> methodData;
void respondWith(Promise<boolean> canMakePaymentResponse);
};
dictionary CanMakePaymentEventInit : ExtendableEventInit {
USVString topOrigin;
USVString paymentRequestOrigin;
sequence<PaymentMethodData> methodData;
};
partial interface ServiceWorkerGlobalScope {
attribute EventHandler onpaymentrequest;
};
dictionary PaymentMethodChangeResponse {
DOMString error;
PaymentCurrencyAmount total;
FrozenArray<PaymentDetailsModifier> modifiers;
object paymentMethodErrors;
};
[Constructor(DOMString type, PaymentRequestEventInit eventInitDict), Exposed=ServiceWorker]
interface PaymentRequestEvent : ExtendableEvent {
readonly attribute USVString topOrigin;
readonly attribute USVString paymentRequestOrigin;
readonly attribute DOMString paymentRequestId;
readonly attribute FrozenArray<PaymentMethodData> methodData;
readonly attribute object total;
readonly attribute FrozenArray<PaymentDetailsModifier> modifiers;
readonly attribute DOMString instrumentKey;
readonly attribute boolean requestBillingAddress;
Promise<WindowClient?> openWindow(USVString url);
Promise<PaymentMethodChangeResponse?> changePaymentMethod(DOMString methodName, optional object? methodDetails = null);
void respondWith(Promise<PaymentHandlerResponse> handlerResponsePromise);
};
dictionary PaymentRequestEventInit : ExtendableEventInit {
USVString topOrigin;
USVString paymentRequestOrigin;
DOMString paymentRequestId;
sequence<PaymentMethodData> methodData;
PaymentCurrencyAmount total;
sequence<PaymentDetailsModifier> modifiers;
DOMString instrumentKey;
};
dictionary PaymentHandlerResponse {
DOMString methodName;
object details;
};