-
Notifications
You must be signed in to change notification settings - Fork 58
/
model_payment_callback_data.go
592 lines (500 loc) · 16.7 KB
/
model_payment_callback_data.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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
/*
Payment Requests
This API is used for Payment Requests
API version: 1.45.2
*/
package payment_request
import (
"encoding/json"
utils "github.com/xendit/xendit-go/v4/utils"
)
// checks if the PaymentCallbackData type satisfies the MappedNullable interface at compile time
var _ utils.MappedNullable = &PaymentCallbackData{}
// PaymentCallbackData Represents the actual funds transaction/attempt made to a payment method
type PaymentCallbackData struct {
Id string `json:"id"`
PaymentRequestId NullableString `json:"payment_request_id,omitempty"`
ReferenceId string `json:"reference_id"`
CustomerId NullableString `json:"customer_id,omitempty"`
Currency string `json:"currency"`
Amount float64 `json:"amount"`
Country string `json:"country"`
Status string `json:"status"`
PaymentMethod PaymentMethod `json:"payment_method"`
ChannelProperties NullablePaymentRequestChannelProperties `json:"channel_properties,omitempty"`
PaymentDetail map[string]interface{} `json:"payment_detail,omitempty"`
FailureCode NullableString `json:"failure_code,omitempty"`
Created string `json:"created"`
Updated string `json:"updated"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
// NewPaymentCallbackData instantiates a new PaymentCallbackData object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewPaymentCallbackData(id string, referenceId string, currency string, amount float64, country string, status string, paymentMethod PaymentMethod, created string, updated string) *PaymentCallbackData {
this := PaymentCallbackData{}
this.Id = id
this.ReferenceId = referenceId
this.Currency = currency
this.Amount = amount
this.Country = country
this.Status = status
this.PaymentMethod = paymentMethod
this.Created = created
this.Updated = updated
return &this
}
// NewPaymentCallbackDataWithDefaults instantiates a new PaymentCallbackData object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewPaymentCallbackDataWithDefaults() *PaymentCallbackData {
this := PaymentCallbackData{}
return &this
}
// GetId returns the Id field value
func (o *PaymentCallbackData) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *PaymentCallbackData) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *PaymentCallbackData) SetId(v string) {
o.Id = v
}
// GetPaymentRequestId returns the PaymentRequestId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PaymentCallbackData) GetPaymentRequestId() string {
if o == nil || utils.IsNil(o.PaymentRequestId.Get()) {
var ret string
return ret
}
return *o.PaymentRequestId.Get()
}
// GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PaymentCallbackData) GetPaymentRequestIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.PaymentRequestId.Get(), o.PaymentRequestId.IsSet()
}
// HasPaymentRequestId returns a boolean if a field has been set.
func (o *PaymentCallbackData) HasPaymentRequestId() bool {
if o != nil && o.PaymentRequestId.IsSet() {
return true
}
return false
}
// SetPaymentRequestId gets a reference to the given NullableString and assigns it to the PaymentRequestId field.
func (o *PaymentCallbackData) SetPaymentRequestId(v string) {
o.PaymentRequestId.Set(&v)
}
// SetPaymentRequestIdNil sets the value for PaymentRequestId to be an explicit nil
func (o *PaymentCallbackData) SetPaymentRequestIdNil() {
o.PaymentRequestId.Set(nil)
}
// UnsetPaymentRequestId ensures that no value is present for PaymentRequestId, not even an explicit nil
func (o *PaymentCallbackData) UnsetPaymentRequestId() {
o.PaymentRequestId.Unset()
}
// GetReferenceId returns the ReferenceId field value
func (o *PaymentCallbackData) GetReferenceId() string {
if o == nil {
var ret string
return ret
}
return o.ReferenceId
}
// GetReferenceIdOk returns a tuple with the ReferenceId field value
// and a boolean to check if the value has been set.
func (o *PaymentCallbackData) GetReferenceIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ReferenceId, true
}
// SetReferenceId sets field value
func (o *PaymentCallbackData) SetReferenceId(v string) {
o.ReferenceId = v
}
// GetCustomerId returns the CustomerId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PaymentCallbackData) GetCustomerId() string {
if o == nil || utils.IsNil(o.CustomerId.Get()) {
var ret string
return ret
}
return *o.CustomerId.Get()
}
// GetCustomerIdOk returns a tuple with the CustomerId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PaymentCallbackData) GetCustomerIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CustomerId.Get(), o.CustomerId.IsSet()
}
// HasCustomerId returns a boolean if a field has been set.
func (o *PaymentCallbackData) HasCustomerId() bool {
if o != nil && o.CustomerId.IsSet() {
return true
}
return false
}
// SetCustomerId gets a reference to the given NullableString and assigns it to the CustomerId field.
func (o *PaymentCallbackData) SetCustomerId(v string) {
o.CustomerId.Set(&v)
}
// SetCustomerIdNil sets the value for CustomerId to be an explicit nil
func (o *PaymentCallbackData) SetCustomerIdNil() {
o.CustomerId.Set(nil)
}
// UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil
func (o *PaymentCallbackData) UnsetCustomerId() {
o.CustomerId.Unset()
}
// GetCurrency returns the Currency field value
func (o *PaymentCallbackData) GetCurrency() string {
if o == nil {
var ret string
return ret
}
return o.Currency
}
// GetCurrencyOk returns a tuple with the Currency field value
// and a boolean to check if the value has been set.
func (o *PaymentCallbackData) GetCurrencyOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Currency, true
}
// SetCurrency sets field value
func (o *PaymentCallbackData) SetCurrency(v string) {
o.Currency = v
}
// GetAmount returns the Amount field value
func (o *PaymentCallbackData) GetAmount() float64 {
if o == nil {
var ret float64
return ret
}
return o.Amount
}
// GetAmountOk returns a tuple with the Amount field value
// and a boolean to check if the value has been set.
func (o *PaymentCallbackData) GetAmountOk() (*float64, bool) {
if o == nil {
return nil, false
}
return &o.Amount, true
}
// SetAmount sets field value
func (o *PaymentCallbackData) SetAmount(v float64) {
o.Amount = v
}
// GetCountry returns the Country field value
func (o *PaymentCallbackData) GetCountry() string {
if o == nil {
var ret string
return ret
}
return o.Country
}
// GetCountryOk returns a tuple with the Country field value
// and a boolean to check if the value has been set.
func (o *PaymentCallbackData) GetCountryOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Country, true
}
// SetCountry sets field value
func (o *PaymentCallbackData) SetCountry(v string) {
o.Country = v
}
// GetStatus returns the Status field value
func (o *PaymentCallbackData) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *PaymentCallbackData) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *PaymentCallbackData) SetStatus(v string) {
o.Status = v
}
// GetPaymentMethod returns the PaymentMethod field value
func (o *PaymentCallbackData) GetPaymentMethod() PaymentMethod {
if o == nil {
var ret PaymentMethod
return ret
}
return o.PaymentMethod
}
// GetPaymentMethodOk returns a tuple with the PaymentMethod field value
// and a boolean to check if the value has been set.
func (o *PaymentCallbackData) GetPaymentMethodOk() (*PaymentMethod, bool) {
if o == nil {
return nil, false
}
return &o.PaymentMethod, true
}
// SetPaymentMethod sets field value
func (o *PaymentCallbackData) SetPaymentMethod(v PaymentMethod) {
o.PaymentMethod = v
}
// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PaymentCallbackData) GetChannelProperties() PaymentRequestChannelProperties {
if o == nil || utils.IsNil(o.ChannelProperties.Get()) {
var ret PaymentRequestChannelProperties
return ret
}
return *o.ChannelProperties.Get()
}
// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PaymentCallbackData) GetChannelPropertiesOk() (*PaymentRequestChannelProperties, bool) {
if o == nil {
return nil, false
}
return o.ChannelProperties.Get(), o.ChannelProperties.IsSet()
}
// HasChannelProperties returns a boolean if a field has been set.
func (o *PaymentCallbackData) HasChannelProperties() bool {
if o != nil && o.ChannelProperties.IsSet() {
return true
}
return false
}
// SetChannelProperties gets a reference to the given NullablePaymentRequestChannelProperties and assigns it to the ChannelProperties field.
func (o *PaymentCallbackData) SetChannelProperties(v PaymentRequestChannelProperties) {
o.ChannelProperties.Set(&v)
}
// SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil
func (o *PaymentCallbackData) SetChannelPropertiesNil() {
o.ChannelProperties.Set(nil)
}
// UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil
func (o *PaymentCallbackData) UnsetChannelProperties() {
o.ChannelProperties.Unset()
}
// GetPaymentDetail returns the PaymentDetail field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PaymentCallbackData) GetPaymentDetail() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.PaymentDetail
}
// GetPaymentDetailOk returns a tuple with the PaymentDetail field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PaymentCallbackData) GetPaymentDetailOk() (map[string]interface{}, bool) {
if o == nil || utils.IsNil(o.PaymentDetail) {
return map[string]interface{}{}, false
}
return o.PaymentDetail, true
}
// HasPaymentDetail returns a boolean if a field has been set.
func (o *PaymentCallbackData) HasPaymentDetail() bool {
if o != nil && utils.IsNil(o.PaymentDetail) {
return true
}
return false
}
// SetPaymentDetail gets a reference to the given map[string]interface{} and assigns it to the PaymentDetail field.
func (o *PaymentCallbackData) SetPaymentDetail(v map[string]interface{}) {
o.PaymentDetail = v
}
// GetFailureCode returns the FailureCode field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PaymentCallbackData) GetFailureCode() string {
if o == nil || utils.IsNil(o.FailureCode.Get()) {
var ret string
return ret
}
return *o.FailureCode.Get()
}
// GetFailureCodeOk returns a tuple with the FailureCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PaymentCallbackData) GetFailureCodeOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.FailureCode.Get(), o.FailureCode.IsSet()
}
// HasFailureCode returns a boolean if a field has been set.
func (o *PaymentCallbackData) HasFailureCode() bool {
if o != nil && o.FailureCode.IsSet() {
return true
}
return false
}
// SetFailureCode gets a reference to the given NullableString and assigns it to the FailureCode field.
func (o *PaymentCallbackData) SetFailureCode(v string) {
o.FailureCode.Set(&v)
}
// SetFailureCodeNil sets the value for FailureCode to be an explicit nil
func (o *PaymentCallbackData) SetFailureCodeNil() {
o.FailureCode.Set(nil)
}
// UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil
func (o *PaymentCallbackData) UnsetFailureCode() {
o.FailureCode.Unset()
}
// GetCreated returns the Created field value
func (o *PaymentCallbackData) GetCreated() string {
if o == nil {
var ret string
return ret
}
return o.Created
}
// GetCreatedOk returns a tuple with the Created field value
// and a boolean to check if the value has been set.
func (o *PaymentCallbackData) GetCreatedOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Created, true
}
// SetCreated sets field value
func (o *PaymentCallbackData) SetCreated(v string) {
o.Created = v
}
// GetUpdated returns the Updated field value
func (o *PaymentCallbackData) GetUpdated() string {
if o == nil {
var ret string
return ret
}
return o.Updated
}
// GetUpdatedOk returns a tuple with the Updated field value
// and a boolean to check if the value has been set.
func (o *PaymentCallbackData) GetUpdatedOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Updated, true
}
// SetUpdated sets field value
func (o *PaymentCallbackData) SetUpdated(v string) {
o.Updated = v
}
// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PaymentCallbackData) GetMetadata() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PaymentCallbackData) GetMetadataOk() (map[string]interface{}, bool) {
if o == nil || utils.IsNil(o.Metadata) {
return map[string]interface{}{}, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *PaymentCallbackData) HasMetadata() bool {
if o != nil && utils.IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field.
func (o *PaymentCallbackData) SetMetadata(v map[string]interface{}) {
o.Metadata = v
}
func (o PaymentCallbackData) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PaymentCallbackData) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
if o.PaymentRequestId.IsSet() {
toSerialize["payment_request_id"] = o.PaymentRequestId.Get()
}
toSerialize["reference_id"] = o.ReferenceId
if o.CustomerId.IsSet() {
toSerialize["customer_id"] = o.CustomerId.Get()
}
toSerialize["currency"] = o.Currency
toSerialize["amount"] = o.Amount
toSerialize["country"] = o.Country
toSerialize["status"] = o.Status
toSerialize["payment_method"] = o.PaymentMethod
if o.ChannelProperties.IsSet() {
toSerialize["channel_properties"] = o.ChannelProperties.Get()
}
if o.PaymentDetail != nil {
toSerialize["payment_detail"] = o.PaymentDetail
}
if o.FailureCode.IsSet() {
toSerialize["failure_code"] = o.FailureCode.Get()
}
toSerialize["created"] = o.Created
toSerialize["updated"] = o.Updated
if o.Metadata != nil {
toSerialize["metadata"] = o.Metadata
}
return toSerialize, nil
}
type NullablePaymentCallbackData struct {
value *PaymentCallbackData
isSet bool
}
func (v NullablePaymentCallbackData) Get() *PaymentCallbackData {
return v.value
}
func (v *NullablePaymentCallbackData) Set(val *PaymentCallbackData) {
v.value = val
v.isSet = true
}
func (v NullablePaymentCallbackData) IsSet() bool {
return v.isSet
}
func (v *NullablePaymentCallbackData) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePaymentCallbackData(val *PaymentCallbackData) *NullablePaymentCallbackData {
return &NullablePaymentCallbackData{value: val, isSet: true}
}
func (v NullablePaymentCallbackData) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePaymentCallbackData) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}