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"
14 namespace mozilla::dom
{
16 class PaymentRequestParent
;
18 class PaymentResponseData
: public nsIPaymentResponseData
{
21 NS_DECL_NSIPAYMENTRESPONSEDATA
23 PaymentResponseData() = default;
26 virtual ~PaymentResponseData() = default;
31 class GeneralResponseData final
: public PaymentResponseData
,
32 public nsIGeneralResponseData
{
34 NS_DECL_ISUPPORTS_INHERITED
35 NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
36 NS_DECL_NSIGENERALRESPONSEDATA
38 GeneralResponseData();
41 ~GeneralResponseData() = default;
46 class BasicCardResponseData final
: public nsIBasicCardResponseData
,
47 public PaymentResponseData
{
49 NS_DECL_ISUPPORTS_INHERITED
50 NS_FORWARD_NSIPAYMENTRESPONSEDATA(PaymentResponseData::)
51 NS_DECL_NSIBASICCARDRESPONSEDATA
53 BasicCardResponseData();
56 ~BasicCardResponseData() = default;
58 nsString mCardholderName
;
60 nsString mExpiryMonth
;
62 nsString mCardSecurityCode
;
63 nsCOMPtr
<nsIPaymentAddress
> mBillingAddress
;
66 class PaymentActionResponse
: public nsIPaymentActionResponse
{
69 NS_DECL_NSIPAYMENTACTIONRESPONSE
71 PaymentActionResponse();
74 virtual ~PaymentActionResponse() = default;
80 class PaymentCanMakeActionResponse final
81 : public nsIPaymentCanMakeActionResponse
,
82 public PaymentActionResponse
{
84 NS_DECL_ISUPPORTS_INHERITED
85 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
86 NS_DECL_NSIPAYMENTCANMAKEACTIONRESPONSE
88 PaymentCanMakeActionResponse();
91 ~PaymentCanMakeActionResponse() = default;
96 class PaymentShowActionResponse final
: public nsIPaymentShowActionResponse
,
97 public PaymentActionResponse
{
99 NS_DECL_ISUPPORTS_INHERITED
100 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
101 NS_DECL_NSIPAYMENTSHOWACTIONRESPONSE
103 PaymentShowActionResponse();
106 ~PaymentShowActionResponse() = default;
108 uint32_t mAcceptStatus
;
109 nsString mMethodName
;
110 nsCOMPtr
<nsIPaymentResponseData
> mData
;
112 nsString mPayerEmail
;
113 nsString mPayerPhone
;
116 class PaymentAbortActionResponse final
: public nsIPaymentAbortActionResponse
,
117 public PaymentActionResponse
{
119 NS_DECL_ISUPPORTS_INHERITED
120 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
121 NS_DECL_NSIPAYMENTABORTACTIONRESPONSE
123 PaymentAbortActionResponse();
126 ~PaymentAbortActionResponse() = default;
128 uint32_t mAbortStatus
;
131 class PaymentCompleteActionResponse final
132 : public nsIPaymentCompleteActionResponse
,
133 public PaymentActionResponse
{
135 NS_DECL_ISUPPORTS_INHERITED
136 NS_FORWARD_NSIPAYMENTACTIONRESPONSE(PaymentActionResponse::)
137 NS_DECL_NSIPAYMENTCOMPLETEACTIONRESPONSE
139 PaymentCompleteActionResponse();
142 ~PaymentCompleteActionResponse() = default;
144 uint32_t mCompleteStatus
;
147 class MethodChangeDetails
: public nsIMethodChangeDetails
{
150 NS_DECL_NSIMETHODCHANGEDETAILS
152 MethodChangeDetails() = default;
155 virtual ~MethodChangeDetails() = default;
160 class GeneralMethodChangeDetails final
: public MethodChangeDetails
,
161 public nsIGeneralChangeDetails
{
163 NS_DECL_ISUPPORTS_INHERITED
164 NS_FORWARD_NSIMETHODCHANGEDETAILS(MethodChangeDetails::)
165 NS_DECL_NSIGENERALCHANGEDETAILS
167 GeneralMethodChangeDetails();
170 ~GeneralMethodChangeDetails() = default;
175 class BasicCardMethodChangeDetails final
: public MethodChangeDetails
,
176 public nsIBasicCardChangeDetails
{
178 NS_DECL_ISUPPORTS_INHERITED
179 NS_FORWARD_NSIMETHODCHANGEDETAILS(MethodChangeDetails::)
180 NS_DECL_NSIBASICCARDCHANGEDETAILS
182 BasicCardMethodChangeDetails();
185 ~BasicCardMethodChangeDetails() = default;
187 nsCOMPtr
<nsIPaymentAddress
> mBillingAddress
;
190 } // namespace mozilla::dom