blob: e2a1c83d7f2971167df59a38f31a9192ba748227 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://w3c.github.io/payment-request/#paymentrequest-interface
// http://crbug.com/587995
[
RuntimeEnabled=PaymentRequest,
Constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details, optional PaymentOptions options),
ConstructorCallWith=ExecutionContext,
RaisesException=Constructor,
SecureContext,
Exposed=Window,
ActiveScriptWrappable
] interface PaymentRequest : EventTarget {
[CallWith=ScriptState, NewObject] Promise<PaymentResponse> show();
[CallWith=ScriptState, NewObject] Promise<void> abort();
[CallWith=ScriptState, HighEntropy, Measure, NewObject] Promise<boolean> canMakePayment();
[CallWith=ScriptState, HighEntropy, Measure, NewObject, RuntimeEnabled=PaymentRequestHasEnrolledInstrument] Promise<boolean> hasEnrolledInstrument();
readonly attribute DOMString id;
[ImplementedAs=getShippingAddress] readonly attribute PaymentAddress? shippingAddress;
readonly attribute DOMString? shippingOption;
readonly attribute PaymentShippingType? shippingType;
attribute EventHandler onshippingaddresschange;
attribute EventHandler onshippingoptionchange;
[RuntimeEnabled=PaymentMethodChangeEvent] attribute EventHandler onpaymentmethodchange;
};