| // 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=Document, |
| 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=CanMakePayment] Promise<boolean> canMakePayment(); |
| }; |