1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_PaymentActionResponse_h
8 #define mozilla_dom_PaymentActionResponse_h
11 #include "nsIPaymentActionResponse.h"
17 class PaymentRequestParent
;
19 class PaymentResponseData
: public nsIPaymentResponseData
{
22 NS_DECL_NSIPAYMENTRESPONSEDATA
24 PaymentResponseData() = default;
27 virtual ~PaymentResponseData() = default;
32 class GeneralResponseData final
: public PaymentResponseData
,
33 public nsIGeneralResponseData
{
35 NS_DECL_ISUPPORTS_INHERITED
36 NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
37 NS_DECL_NSIGENERALRESPONSEDATA
39 GeneralResponseData();
42 ~GeneralResponseData() = default;
47 class BasicCardResponseData final
: public nsIBasicCardResponseData
,
48 public PaymentResponseData
{
50 NS_DECL_ISUPPORTS_INHERITED
51 NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
52 NS_DECL_NSIBASICCARDRESPONSEDATA
54 BasicCardResponseData();
57 ~BasicCardResponseData() = default;
59 nsString mCardholderName
;
61 nsString mExpiryMonth
;
63 nsString mCardSecurityCode
;
64 nsCOMPtr
<nsIPaymentAddress
> mBillingAddress
;
67 class PaymentActionResponse
: public nsIPaymentActionResponse
{
70 NS_DECL_NSIPAYMENTACTIONRESPONSE
72 PaymentActionResponse();
75 virtual ~PaymentActionResponse() = default;
81 class PaymentCanMakeActionResponse final
82 : public nsIPaymentCanMakeActionResponse
,
83 public PaymentActionResponse
{
85 NS_DECL_ISUPPORTS_INHERITED
86 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
87 NS_DECL_NSIPAYMENTCANMAKEACTIONRESPONSE
89 PaymentCanMakeActionResponse();
92 ~PaymentCanMakeActionResponse() = default;
97 class PaymentShowActionResponse final
: public nsIPaymentShowActionResponse
,
98 public PaymentActionResponse
{
100 NS_DECL_ISUPPORTS_INHERITED
101 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
102 NS_DECL_NSIPAYMENTSHOWACTIONRESPONSE
104 PaymentShowActionResponse();
107 ~PaymentShowActionResponse() = default;
109 uint32_t mAcceptStatus
;
110 nsString mMethodName
;
111 nsCOMPtr
<nsIPaymentResponseData
> mData
;
113 nsString mPayerEmail
;
114 nsString mPayerPhone
;
117 class PaymentAbortActionResponse final
: public nsIPaymentAbortActionResponse
,
118 public PaymentActionResponse
{
120 NS_DECL_ISUPPORTS_INHERITED
121 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
122 NS_DECL_NSIPAYMENTABORTACTIONRESPONSE
124 PaymentAbortActionResponse();
127 ~PaymentAbortActionResponse() = default;
129 uint32_t mAbortStatus
;
132 class PaymentCompleteActionResponse final
133 : public nsIPaymentCompleteActionResponse
,
134 public PaymentActionResponse
{
136 NS_DECL_ISUPPORTS_INHERITED
137 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
138 NS_DECL_NSIPAYMENTCOMPLETEACTIONRESPONSE
140 PaymentCompleteActionResponse();
143 ~PaymentCompleteActionResponse() = default;
145 uint32_t mCompleteStatus
;
148 class MethodChangeDetails
: public nsIMethodChangeDetails
{
151 NS_DECL_NSIMETHODCHANGEDETAILS
153 MethodChangeDetails() = default;
156 virtual ~MethodChangeDetails() = default;
161 class GeneralMethodChangeDetails final
: public MethodChangeDetails
,
162 public nsIGeneralChangeDetails
{
164 NS_DECL_ISUPPORTS_INHERITED
165 NS_FORWARD_NSIMETHODCHANGEDETAILS(MethodChangeDetails::)
166 NS_DECL_NSIGENERALCHANGEDETAILS
168 GeneralMethodChangeDetails();
171 ~GeneralMethodChangeDetails() = default;
176 class BasicCardMethodChangeDetails final
: public MethodChangeDetails
,
177 public nsIBasicCardChangeDetails
{
179 NS_DECL_ISUPPORTS_INHERITED
180 NS_FORWARD_NSIMETHODCHANGEDETAILS(MethodChangeDetails::)
181 NS_DECL_NSIBASICCARDCHANGEDETAILS
183 BasicCardMethodChangeDetails();
186 ~BasicCardMethodChangeDetails() = default;
188 nsCOMPtr
<nsIPaymentAddress
> mBillingAddress
;
192 } // end of namespace mozilla