-
Notifications
You must be signed in to change notification settings - Fork 5
/
order.go
326 lines (241 loc) · 8.14 KB
/
order.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
// 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"
)
// Order Order
//
// swagger:model Order.
type Order struct {
// chargebackreversedtime
// Format: date-time
ChargebackReversedTime *strfmt.DateTime `json:"chargebackReversedTime,omitempty"`
// chargebacktime
// Format: date-time
ChargebackTime *strfmt.DateTime `json:"chargebackTime,omitempty"`
// charged
Charged bool `json:"charged"`
// chargedtime
// Format: date-time
ChargedTime *strfmt.DateTime `json:"chargedTime,omitempty"`
// countitemid
CountItemID string `json:"countItemId,omitempty"`
// countnamespace
CountNamespace string `json:"countNamespace,omitempty"`
// countuserid
CountUserID string `json:"countUserId,omitempty"`
// createdat
// Format: date-time
CreatedAt *strfmt.DateTime `json:"createdAt,omitempty"`
// createdtime
// Format: date-time
CreatedTime *strfmt.DateTime `json:"createdTime,omitempty"`
// creationoptions
CreationOptions *OrderCreationOptions `json:"creationOptions,omitempty"`
// currency
Currency *CurrencySummary `json:"currency,omitempty"`
// deduction
// Format: int32
Deduction int32 `json:"deduction,omitempty"`
// deductiondetails
DeductionDetails []*DeductionDetail `json:"deductionDetails,omitempty"`
// discountedprice
// Format: int32
DiscountedPrice int32 `json:"discountedPrice,omitempty"`
// expiretime
// Format: date-time
ExpireTime *strfmt.DateTime `json:"expireTime,omitempty"`
// ext
Ext interface{} `json:"ext,omitempty"`
// finalprice
// Format: int32
FinalPrice int32 `json:"finalPrice,omitempty"`
// free
Free bool `json:"free"`
// fulfilledtime
// Format: date-time
FulfilledTime *strfmt.DateTime `json:"fulfilledTime,omitempty"`
// itemid
ItemID string `json:"itemId,omitempty"`
// itemsnapshot
ItemSnapshot *ItemSnapshot `json:"itemSnapshot,omitempty"`
// language
Language string `json:"language,omitempty"`
// namespace
Namespace string `json:"namespace,omitempty"`
// orderbundleiteminfos
OrderBundleItemInfos []*OrderBundleItemInfo `json:"orderBundleItemInfos,omitempty"`
// orderno
OrderNo string `json:"orderNo,omitempty"`
// paymentmethod
PaymentMethod string `json:"paymentMethod,omitempty"`
// paymentmethodfee
// Format: int32
PaymentMethodFee int32 `json:"paymentMethodFee,omitempty"`
// paymentorderno
PaymentOrderNo string `json:"paymentOrderNo,omitempty"`
// paymentprovider
// Enum: ['ADYEN', 'ALIPAY', 'CHECKOUT', 'PAYPAL', 'STRIPE', 'WALLET', 'WXPAY', 'XSOLLA']
PaymentProvider string `json:"paymentProvider,omitempty"`
// paymentproviderfee
// Format: int32
PaymentProviderFee int32 `json:"paymentProviderFee,omitempty"`
// paymentremainseconds
// Format: int32
PaymentRemainSeconds int32 `json:"paymentRemainSeconds,omitempty"`
// paymentstationurl
PaymentStationURL string `json:"paymentStationUrl,omitempty"`
// price
// Format: int32
Price int32 `json:"price,omitempty"`
// quantity
// Format: int32
Quantity int32 `json:"quantity,omitempty"`
// refundedtime
// Format: date-time
RefundedTime *strfmt.DateTime `json:"refundedTime,omitempty"`
// region
Region string `json:"region,omitempty"`
// returnurl
ReturnURL string `json:"returnUrl,omitempty"`
// rvn
// Format: int32
Rvn int32 `json:"rvn,omitempty"`
// salestax
// Format: int32
SalesTax int32 `json:"salesTax,omitempty"`
// sandbox
Sandbox bool `json:"sandbox"`
// status
// Enum: ['CHARGEBACK', 'CHARGEBACK_REVERSED', 'CHARGED', 'CLOSED', 'DELETED', 'FULFILLED', 'FULFILL_FAILED', 'INIT', 'REFUNDED', 'REFUNDING', 'REFUND_FAILED']
Status string `json:"status,omitempty"`
// statusreason
StatusReason string `json:"statusReason,omitempty"`
// subtotalprice
// Format: int32
SubtotalPrice int32 `json:"subtotalPrice,omitempty"`
// tax
// Format: int32
Tax int32 `json:"tax,omitempty"`
// totalprice
// Format: int32
TotalPrice int32 `json:"totalPrice,omitempty"`
// totaltax
// Format: int32
TotalTax int32 `json:"totalTax,omitempty"`
// updatedat
// Format: date-time
UpdatedAt *strfmt.DateTime `json:"updatedAt,omitempty"`
// userid
UserID string `json:"userId,omitempty"`
// vat
// Format: int32
Vat int32 `json:"vat,omitempty"`
}
// Validate validates this Order
func (m *Order) Validate(formats strfmt.Registry) error {
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var orderTypePaymentProviderPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["ADYEN", "ALIPAY", "CHECKOUT", "PAYPAL", "STRIPE", "WALLET", "WXPAY", "XSOLLA"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
orderTypePaymentProviderPropEnum = append(orderTypePaymentProviderPropEnum, v)
}
}
const (
// OrderPaymentProviderADYEN captures enum value "ADYEN"
OrderPaymentProviderADYEN string = "ADYEN"
// OrderPaymentProviderALIPAY captures enum value "ALIPAY"
OrderPaymentProviderALIPAY string = "ALIPAY"
// OrderPaymentProviderCHECKOUT captures enum value "CHECKOUT"
OrderPaymentProviderCHECKOUT string = "CHECKOUT"
// OrderPaymentProviderPAYPAL captures enum value "PAYPAL"
OrderPaymentProviderPAYPAL string = "PAYPAL"
// OrderPaymentProviderSTRIPE captures enum value "STRIPE"
OrderPaymentProviderSTRIPE string = "STRIPE"
// OrderPaymentProviderWALLET captures enum value "WALLET"
OrderPaymentProviderWALLET string = "WALLET"
// OrderPaymentProviderWXPAY captures enum value "WXPAY"
OrderPaymentProviderWXPAY string = "WXPAY"
// OrderPaymentProviderXSOLLA captures enum value "XSOLLA"
OrderPaymentProviderXSOLLA string = "XSOLLA"
)
// prop value enum
func (m *Order) validatePaymentProviderEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, orderTypePaymentProviderPropEnum, true); err != nil {
return err
}
return nil
}
var orderTypeStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["CHARGEBACK", "CHARGEBACK_REVERSED", "CHARGED", "CLOSED", "DELETED", "FULFILLED", "FULFILL_FAILED", "INIT", "REFUNDED", "REFUNDING", "REFUND_FAILED"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
orderTypeStatusPropEnum = append(orderTypeStatusPropEnum, v)
}
}
const (
// OrderStatusCHARGEBACK captures enum value "CHARGEBACK"
OrderStatusCHARGEBACK string = "CHARGEBACK"
// OrderStatusCHARGEBACKREVERSED captures enum value "CHARGEBACK_REVERSED"
OrderStatusCHARGEBACKREVERSED string = "CHARGEBACK_REVERSED"
// OrderStatusCHARGED captures enum value "CHARGED"
OrderStatusCHARGED string = "CHARGED"
// OrderStatusCLOSED captures enum value "CLOSED"
OrderStatusCLOSED string = "CLOSED"
// OrderStatusDELETED captures enum value "DELETED"
OrderStatusDELETED string = "DELETED"
// OrderStatusFULFILLED captures enum value "FULFILLED"
OrderStatusFULFILLED string = "FULFILLED"
// OrderStatusFULFILLFAILED captures enum value "FULFILL_FAILED"
OrderStatusFULFILLFAILED string = "FULFILL_FAILED"
// OrderStatusINIT captures enum value "INIT"
OrderStatusINIT string = "INIT"
// OrderStatusREFUNDED captures enum value "REFUNDED"
OrderStatusREFUNDED string = "REFUNDED"
// OrderStatusREFUNDING captures enum value "REFUNDING"
OrderStatusREFUNDING string = "REFUNDING"
// OrderStatusREFUNDFAILED captures enum value "REFUND_FAILED"
OrderStatusREFUNDFAILED string = "REFUND_FAILED"
)
// prop value enum
func (m *Order) validateStatusEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, orderTypeStatusPropEnum, true); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *Order) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Order) UnmarshalBinary(b []byte) error {
var res Order
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}