// GENERATED CONTENT - DO NOT EDIT // Content was automatically extracted by Reffy into webref // (https://github.com/w3c/webref) // Source: Payment Handler API (https://w3c.github.io/payment-handler/) partial interface ServiceWorkerRegistration { [SameObject] readonly attribute PaymentManager paymentManager; }; [SecureContext, Exposed=(Window)] interface PaymentManager { attribute DOMString userHint; Promise enableDelegations(sequence delegations); }; enum PaymentDelegation { "shippingAddress", "payerName", "payerPhone", "payerEmail" }; partial interface ServiceWorkerGlobalScope { attribute EventHandler oncanmakepayment; }; [Exposed=ServiceWorker] interface CanMakePaymentEvent : ExtendableEvent { constructor(DOMString type); undefined respondWith(Promise canMakePaymentResponse); }; partial interface ServiceWorkerGlobalScope { attribute EventHandler onpaymentrequest; }; dictionary PaymentRequestDetailsUpdate { DOMString error; PaymentCurrencyAmount total; sequence modifiers; sequence shippingOptions; object paymentMethodErrors; AddressErrors shippingAddressErrors; }; [Exposed=ServiceWorker] interface PaymentRequestEvent : ExtendableEvent { constructor(DOMString type, optional PaymentRequestEventInit eventInitDict = {}); readonly attribute USVString topOrigin; readonly attribute USVString paymentRequestOrigin; readonly attribute DOMString paymentRequestId; readonly attribute FrozenArray methodData; readonly attribute object total; readonly attribute FrozenArray modifiers; readonly attribute object? paymentOptions; readonly attribute FrozenArray? shippingOptions; Promise openWindow(USVString url); Promise changePaymentMethod(DOMString methodName, optional object? methodDetails = null); Promise changeShippingAddress(optional AddressInit shippingAddress = {}); Promise changeShippingOption(DOMString shippingOption); undefined respondWith(Promise handlerResponsePromise); }; dictionary PaymentRequestEventInit : ExtendableEventInit { USVString topOrigin; USVString paymentRequestOrigin; DOMString paymentRequestId; sequence methodData; PaymentCurrencyAmount total; sequence modifiers; PaymentOptions paymentOptions; sequence shippingOptions; }; dictionary PaymentHandlerResponse { DOMString methodName; object details; DOMString? payerName; DOMString? payerEmail; DOMString? payerPhone; AddressInit shippingAddress; DOMString? shippingOption; }; dictionary AddressInit { DOMString country = ""; sequence addressLine = []; DOMString region = ""; DOMString city = ""; DOMString dependentLocality = ""; DOMString postalCode = ""; DOMString sortingCode = ""; DOMString organization = ""; DOMString recipient = ""; DOMString phone = ""; }; dictionary PaymentOptions { boolean requestPayerName = false; boolean requestBillingAddress = false; boolean requestPayerEmail = false; boolean requestPayerPhone = false; boolean requestShipping = false; PaymentShippingType shippingType = "shipping"; }; dictionary PaymentShippingOption { required DOMString id; required DOMString label; required PaymentCurrencyAmount amount; boolean selected = false; }; enum PaymentShippingType { "shipping", "delivery", "pickup" }; dictionary AddressErrors { DOMString addressLine; DOMString city; DOMString country; DOMString dependentLocality; DOMString organization; DOMString phone; DOMString postalCode; DOMString recipient; DOMString region; DOMString sortingCode; };