summaryrefslogtreecommitdiffstats
path: root/dom/interfaces/payments/nsIPaymentRequest.idl
blob: ea5b6cba472ef9792ec28e6041972da96c9050cc (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"
#include "nsIVariant.idl"
#include "nsIPrincipal.idl"

interface nsIArray;

[scriptable, builtinclass, uuid(2fe296cc-d917-4820-b492-aa42df23f9b4)]
interface nsIPaymentMethodData : nsISupports
{
  readonly attribute AString supportedMethods;
  [implicit_jscontext]
  readonly attribute jsval data;
};

[scriptable, builtinclass, uuid(d22a6f5f-767b-4fea-bf92-68b0b8003eba)]
interface nsIPaymentCurrencyAmount : nsISupports
{
  readonly attribute AString currency;
  readonly attribute AString value;
};

[scriptable, builtinclass, uuid(4f78a59f-b5ff-4fb5-ab48-3b37d0101b02)]
interface nsIPaymentItem : nsISupports
{
  readonly attribute AString label;
  readonly attribute nsIPaymentCurrencyAmount amount;
  readonly attribute boolean pending;
};

[scriptable, builtinclass, uuid(74259861-c318-40e8-b3d5-518e701bed80)]
interface nsIPaymentDetailsModifier : nsISupports
{
  readonly attribute AString supportedMethods;
  readonly attribute nsIPaymentItem total;
  readonly attribute nsIArray additionalDisplayItems;
  [implicit_jscontext]
  readonly attribute jsval data;
};

[scriptable, builtinclass, uuid(68341551-3605-4381-b936-41e830aa88fb)]
interface nsIPaymentShippingOption : nsISupports
{
  readonly attribute AString id;
  readonly attribute AString label;
  readonly attribute nsIPaymentCurrencyAmount amount;
  attribute boolean selected;
};

[scriptable, builtinclass, uuid(73a5a3f1-45b9-4605-a6e6-7aa60daa9039)]
interface nsIPaymentDetails : nsISupports
{
  readonly attribute AString id;
  readonly attribute nsIPaymentItem totalItem;
  readonly attribute nsIArray displayItems;
  readonly attribute nsIArray shippingOptions;
  readonly attribute nsIArray modifiers;
  readonly attribute AString error;
  [implicit_jscontext]
  readonly attribute jsval shippingAddressErrors;
  [implicit_jscontext]
  readonly attribute jsval payerErrors;
  [implicit_jscontext]
  readonly attribute jsval paymentMethodErrors;
};

[scriptable, builtinclass, uuid(d53f9f20-138e-47cc-9fd5-db16a3f6d301)]
interface nsIPaymentOptions : nsISupports
{
  readonly attribute boolean requestPayerName;
  readonly attribute boolean requestPayerEmail;
  readonly attribute boolean requestPayerPhone;
  readonly attribute boolean requestShipping;
  readonly attribute boolean requestBillingAddress;
  readonly attribute AString shippingType;
};

[scriptable, builtinclass, uuid(2fa36783-d684-4487-b7a8-9def6ae3128f)]
interface nsIPaymentRequest : nsISupports
{
  readonly attribute uint64_t topOuterWindowId;
  readonly attribute nsIPrincipal topLevelPrincipal;
  readonly attribute AString requestId;
  readonly attribute AString completeStatus;
  readonly attribute nsIArray paymentMethods;
  readonly attribute nsIPaymentDetails paymentDetails;
  readonly attribute nsIPaymentOptions paymentOptions;
  readonly attribute AString shippingOption;
};