-
Notifications
You must be signed in to change notification settings - Fork 6
/
transaction.go
249 lines (188 loc) · 6.73 KB
/
transaction.go
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
// Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.
// Code generated; DO NOT EDIT.
package platformclientmodels
import (
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// Transaction Transaction
//
// swagger:model Transaction.
type Transaction struct {
// additionaldata
AdditionalData *AdditionalData `json:"additionalData,omitempty"`
// amount
// Format: int32
Amount int32 `json:"amount,omitempty"`
// currency
Currency *CurrencySummary `json:"currency,omitempty"`
// extmessage
ExtMessage string `json:"extMessage,omitempty"`
// extstatuscode
ExtStatusCode string `json:"extStatusCode,omitempty"`
// exttxid
ExtTxID string `json:"extTxId,omitempty"`
// merchantid
MerchantID string `json:"merchantId,omitempty"`
// notified
Notified bool `json:"notified"`
// paymentdata
PaymentData *PaymentData `json:"paymentData,omitempty"`
// paymentmethod
PaymentMethod string `json:"paymentMethod,omitempty"`
// paymentmethodfee
// Format: int32
PaymentMethodFee int32 `json:"paymentMethodFee,omitempty"`
// paymentproviderfee
// Format: int32
PaymentProviderFee int32 `json:"paymentProviderFee,omitempty"`
// provider
// Enum: ['ADYEN', 'ALIPAY', 'CHECKOUT', 'NEONPAY', 'PAYPAL', 'STRIPE', 'WALLET', 'WXPAY', 'XSOLLA']
Provider string `json:"provider,omitempty"`
// salestax
// Format: int32
SalesTax int32 `json:"salesTax,omitempty"`
// status
// Enum: ['FAILED', 'FINISHED']
Status string `json:"status,omitempty"`
// tax
// Format: int32
Tax int32 `json:"tax,omitempty"`
// txendtime
// Format: date-time
TxEndTime *strfmt.DateTime `json:"txEndTime,omitempty"`
// txid
TxID string `json:"txId,omitempty"`
// type
// Enum: ['AUTHORISATION', 'CHARGE', 'CHARGEBACK', 'CHARGEBACK_REVERSED', 'CHARGE_FAILED', 'NOTIFICATION_OF_CHARGEBACK', 'REFUND', 'REFUND_FAILED', 'REQUEST_FOR_INFORMATION']
Type string `json:"type,omitempty"`
// vat
// Format: int32
Vat int32 `json:"vat,omitempty"`
}
// Validate validates this Transaction
func (m *Transaction) Validate(formats strfmt.Registry) error {
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var transactionTypeProviderPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["ADYEN", "ALIPAY", "CHECKOUT", "NEONPAY", "PAYPAL", "STRIPE", "WALLET", "WXPAY", "XSOLLA"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
transactionTypeProviderPropEnum = append(transactionTypeProviderPropEnum, v)
}
}
const (
// TransactionProviderADYEN captures enum value "ADYEN"
TransactionProviderADYEN string = "ADYEN"
// TransactionProviderALIPAY captures enum value "ALIPAY"
TransactionProviderALIPAY string = "ALIPAY"
// TransactionProviderCHECKOUT captures enum value "CHECKOUT"
TransactionProviderCHECKOUT string = "CHECKOUT"
// TransactionProviderNEONPAY captures enum value "NEONPAY"
TransactionProviderNEONPAY string = "NEONPAY"
// TransactionProviderPAYPAL captures enum value "PAYPAL"
TransactionProviderPAYPAL string = "PAYPAL"
// TransactionProviderSTRIPE captures enum value "STRIPE"
TransactionProviderSTRIPE string = "STRIPE"
// TransactionProviderWALLET captures enum value "WALLET"
TransactionProviderWALLET string = "WALLET"
// TransactionProviderWXPAY captures enum value "WXPAY"
TransactionProviderWXPAY string = "WXPAY"
// TransactionProviderXSOLLA captures enum value "XSOLLA"
TransactionProviderXSOLLA string = "XSOLLA"
)
// prop value enum
func (m *Transaction) validateProviderEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, transactionTypeProviderPropEnum, true); err != nil {
return err
}
return nil
}
var transactionTypeStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["FAILED", "FINISHED"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
transactionTypeStatusPropEnum = append(transactionTypeStatusPropEnum, v)
}
}
const (
// TransactionStatusFAILED captures enum value "FAILED"
TransactionStatusFAILED string = "FAILED"
// TransactionStatusFINISHED captures enum value "FINISHED"
TransactionStatusFINISHED string = "FINISHED"
)
// prop value enum
func (m *Transaction) validateStatusEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, transactionTypeStatusPropEnum, true); err != nil {
return err
}
return nil
}
var transactionTypeTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["AUTHORISATION", "CHARGE", "CHARGEBACK", "CHARGEBACK_REVERSED", "CHARGE_FAILED", "NOTIFICATION_OF_CHARGEBACK", "REFUND", "REFUND_FAILED", "REQUEST_FOR_INFORMATION"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
transactionTypeTypePropEnum = append(transactionTypeTypePropEnum, v)
}
}
const (
// TransactionTypeAUTHORISATION captures enum value "AUTHORISATION"
TransactionTypeAUTHORISATION string = "AUTHORISATION"
// TransactionTypeCHARGE captures enum value "CHARGE"
TransactionTypeCHARGE string = "CHARGE"
// TransactionTypeCHARGEBACK captures enum value "CHARGEBACK"
TransactionTypeCHARGEBACK string = "CHARGEBACK"
// TransactionTypeCHARGEBACKREVERSED captures enum value "CHARGEBACK_REVERSED"
TransactionTypeCHARGEBACKREVERSED string = "CHARGEBACK_REVERSED"
// TransactionTypeCHARGEFAILED captures enum value "CHARGE_FAILED"
TransactionTypeCHARGEFAILED string = "CHARGE_FAILED"
// TransactionTypeNOTIFICATIONOFCHARGEBACK captures enum value "NOTIFICATION_OF_CHARGEBACK"
TransactionTypeNOTIFICATIONOFCHARGEBACK string = "NOTIFICATION_OF_CHARGEBACK"
// TransactionTypeREFUND captures enum value "REFUND"
TransactionTypeREFUND string = "REFUND"
// TransactionTypeREFUNDFAILED captures enum value "REFUND_FAILED"
TransactionTypeREFUNDFAILED string = "REFUND_FAILED"
// TransactionTypeREQUESTFORINFORMATION captures enum value "REQUEST_FOR_INFORMATION"
TransactionTypeREQUESTFORINFORMATION string = "REQUEST_FOR_INFORMATION"
)
// prop value enum
func (m *Transaction) validateTypeEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, transactionTypeTypePropEnum, true); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *Transaction) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Transaction) UnmarshalBinary(b []byte) error {
var res Transaction
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}