blob: fa7c6e32d0bc9368eb3cc34fa6a2335914ad4078 [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/browser-payment-api/#paymentrequest-interface
// http://crbug.com/587995
[
RuntimeEnabled=PaymentRequest,
Constructor(sequence<PaymentMethodData> methodData, PaymentDetails details, optional PaymentOptions options),
ConstructorCallWith=ScriptState,
RaisesException=Constructor,
ActiveScriptWrappable,
DependentLifetime,
] interface PaymentRequest : EventTarget {
[CallWith=ScriptState] Promise<PaymentResponse> show();
[CallWith=ScriptState] Promise<void> abort();
[ImplementedAs=getShippingAddress] readonly attribute PaymentAddress? shippingAddress;
readonly attribute DOMString? shippingOption;
readonly attribute PaymentShippingType? shippingType;
attribute EventHandler onshippingaddresschange;
attribute EventHandler onshippingoptionchange;
// https://github.com/w3c/browser-payment-api/issues/310
[CallWith=ScriptState, RuntimeEnabled=CanMakeActivePayment] Promise<boolean> canMakeActivePayment();
};