summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/payments/payment_response.idl
blob: 6401233f885c2d3252e41df8907f7d7c882480d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// 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/#dom-paymentcomplete

enum PaymentComplete {
    "fail",
    "success",
    "unknown"
};

// https://w3c.github.io/payment-request/#dom-paymentresponse

[
    RuntimeEnabled=PaymentRequest,
    SecureContext,
    Exposed=Window,
    ActiveScriptWrappable
] interface PaymentResponse : EventTarget {
    [CallWith=ScriptState, ImplementedAs=toJSONForBinding] object toJSON();

    readonly attribute DOMString requestId;
    readonly attribute DOMString methodName;
    [CallWith=ScriptState] readonly attribute object details;
    readonly attribute PaymentAddress? shippingAddress;
    readonly attribute DOMString? shippingOption;
    readonly attribute DOMString? payerName;
    readonly attribute DOMString? payerEmail;
    readonly attribute DOMString? payerPhone;

    [CallWith=ScriptState, NewObject] Promise<void> complete(optional PaymentComplete paymentResult = "unknown");
    [CallWith=ScriptState, NewObject, RuntimeEnabled=PaymentRetry] Promise<void> retry(optional PaymentValidationErrors errorFields);

    [RuntimeEnabled=PaymentRetry] attribute EventHandler onpayerdetailchange;
};