summaryrefslogtreecommitdiffstats
path: root/test/wpt/tests/interfaces/payment-request.idl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 20:56:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 20:56:19 +0000
commit0b6210cd37b68b94252cb798598b12974a20e1c1 (patch)
treee371686554a877842d95aa94f100bee552ff2a8e /test/wpt/tests/interfaces/payment-request.idl
parentInitial commit. (diff)
downloadnode-undici-upstream.tar.xz
node-undici-upstream.zip
Adding upstream version 5.28.2+dfsg1+~cs23.11.12.3.upstream/5.28.2+dfsg1+_cs23.11.12.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/wpt/tests/interfaces/payment-request.idl')
-rw-r--r--test/wpt/tests/interfaces/payment-request.idl112
1 files changed, 112 insertions, 0 deletions
diff --git a/test/wpt/tests/interfaces/payment-request.idl b/test/wpt/tests/interfaces/payment-request.idl
new file mode 100644
index 0000000..0a97d4d
--- /dev/null
+++ b/test/wpt/tests/interfaces/payment-request.idl
@@ -0,0 +1,112 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content was automatically extracted by Reffy into webref
+// (https://github.com/w3c/webref)
+// Source: Payment Request API 1.1 (https://w3c.github.io/payment-request/)
+
+[SecureContext, Exposed=Window]
+interface PaymentRequest : EventTarget {
+ constructor(
+ sequence<PaymentMethodData> methodData,
+ PaymentDetailsInit details
+ );
+ [NewObject]
+ Promise<PaymentResponse> show(optional Promise<PaymentDetailsUpdate> detailsPromise);
+ [NewObject]
+ Promise<undefined> abort();
+ [NewObject]
+ Promise<boolean> canMakePayment();
+
+ readonly attribute DOMString id;
+
+ attribute EventHandler onpaymentmethodchange;
+};
+
+dictionary PaymentMethodData {
+ required DOMString supportedMethods;
+ object data;
+};
+
+dictionary PaymentCurrencyAmount {
+ required DOMString currency;
+ required DOMString value;
+};
+
+dictionary PaymentDetailsBase {
+ sequence<PaymentItem> displayItems;
+ sequence<PaymentDetailsModifier> modifiers;
+};
+
+dictionary PaymentDetailsInit : PaymentDetailsBase {
+ DOMString id;
+ required PaymentItem total;
+};
+
+dictionary PaymentDetailsUpdate : PaymentDetailsBase {
+ PaymentItem total;
+ object paymentMethodErrors;
+};
+
+dictionary PaymentDetailsModifier {
+ required DOMString supportedMethods;
+ PaymentItem total;
+ sequence<PaymentItem> additionalDisplayItems;
+ object data;
+};
+
+dictionary PaymentItem {
+ required DOMString label;
+ required PaymentCurrencyAmount amount;
+ boolean pending = false;
+};
+
+dictionary PaymentCompleteDetails {
+ object? data = null;
+};
+
+enum PaymentComplete {
+ "fail",
+ "success",
+ "unknown"
+};
+
+[SecureContext, Exposed=Window]
+interface PaymentResponse : EventTarget {
+ [Default] object toJSON();
+
+ readonly attribute DOMString requestId;
+ readonly attribute DOMString methodName;
+ readonly attribute object details;
+
+ [NewObject]
+ Promise<undefined> complete(
+ optional PaymentComplete result = "unknown",
+ optional PaymentCompleteDetails details = {}
+ );
+ [NewObject]
+ Promise<undefined> retry(optional PaymentValidationErrors errorFields = {});
+};
+
+dictionary PaymentValidationErrors {
+ DOMString error;
+ object paymentMethod;
+};
+
+[SecureContext, Exposed=Window]
+interface PaymentMethodChangeEvent : PaymentRequestUpdateEvent {
+ constructor(DOMString type, optional PaymentMethodChangeEventInit eventInitDict = {});
+ readonly attribute DOMString methodName;
+ readonly attribute object? methodDetails;
+};
+
+dictionary PaymentMethodChangeEventInit : PaymentRequestUpdateEventInit {
+ DOMString methodName = "";
+ object? methodDetails = null;
+};
+
+[SecureContext, Exposed=Window]
+interface PaymentRequestUpdateEvent : Event {
+ constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict = {});
+ undefined updateWith(Promise<PaymentDetailsUpdate> detailsPromise);
+};
+
+dictionary PaymentRequestUpdateEventInit : EventInit {};