blob: 259549a503d477cc4a099f105014faaa1f1de11c [file] [log] [blame]
// 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,Worker)]
interface PaymentManager {
[SameObject] readonly attribute PaymentInstruments instruments;
attribute DOMString userHint;
Promise<void> enableDelegations(sequence<PaymentDelegation> delegations);
};
enum PaymentDelegation {
"shippingAddress",
"payerName",
"payerPhone",
"payerEmail"
};
[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;
};
[Exposed=ServiceWorker]
interface CanMakePaymentEvent : ExtendableEvent {
constructor(DOMString type, optional CanMakePaymentEventInit eventInitDict = {});
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 PaymentRequestDetailsUpdate {
DOMString error;
PaymentCurrencyAmount total;
sequence<PaymentDetailsModifier> modifiers;
sequence<PaymentShippingOption> 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<PaymentMethodData> methodData;
readonly attribute object total;
readonly attribute FrozenArray<PaymentDetailsModifier> modifiers;
readonly attribute DOMString instrumentKey;
readonly attribute boolean requestBillingAddress;
readonly attribute object? paymentOptions;
readonly attribute FrozenArray<PaymentShippingOption>? shippingOptions;
Promise<WindowClient?> openWindow(USVString url);
Promise<PaymentRequestDetailsUpdate?> changePaymentMethod(DOMString methodName, optional object? methodDetails = null);
Promise<PaymentRequestDetailsUpdate?> changeShippingAddress(optional AddressInit shippingAddress = {});
Promise<PaymentRequestDetailsUpdate?> changeShippingOption(DOMString shippingOption);
void respondWith(Promise<PaymentHandlerResponse> handlerResponsePromise);
};
dictionary PaymentRequestEventInit : ExtendableEventInit {
USVString topOrigin;
USVString paymentRequestOrigin;
DOMString paymentRequestId;
sequence<PaymentMethodData> methodData;
PaymentCurrencyAmount total;
sequence<PaymentDetailsModifier> modifiers;
DOMString instrumentKey;
PaymentOptions paymentOptions;
sequence<PaymentShippingOption> shippingOptions;
};
dictionary PaymentHandlerResponse {
DOMString methodName;
object details;
DOMString? payerName;
DOMString? payerEmail;
DOMString? payerPhone;
AddressInit shippingAddress;
DOMString? shippingOption;
};