-
Notifications
You must be signed in to change notification settings - Fork 3
/
model_card.go
608 lines (517 loc) · 16.4 KB
/
model_card.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
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
/*
Cashfree Payment Gateway APIs
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
API version: 2022-09-01
Contact: developers@cashfree.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package cashfree_pg
import (
"encoding/json"
)
// checks if the Card type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Card{}
// Card Card Payment method
type Card struct {
// The channel for card payments can be \"link\" or \"post\". Post is used for seamless OTP payments where merchant captures OTP on their own page.
Channel *string `json:"channel,omitempty"`
// Customer card number for plain card transactions. Token pan number for tokenized card transactions.
CardNumber *string `json:"card_number,omitempty"`
// Customer name mentioned on the card.
CardHolderName *string `json:"card_holder_name,omitempty"`
// Card expiry month for plain card transactions. Token expiry month for tokenized card transactions.
CardExpiryMm *string `json:"card_expiry_mm,omitempty"`
// Card expiry year for plain card transactions. Token expiry year for tokenized card transactions.
CardExpiryYy *string `json:"card_expiry_yy,omitempty"`
// CVV mentioned on the card.
CardCvv *string `json:"card_cvv,omitempty"`
// instrument id of saved card. Required only to make payment using saved instrument.
InstrumentId *string `json:"instrument_id,omitempty"`
// cryptogram received from card network. Required only for tokenized card transactions.
Cryptogram *string `json:"cryptogram,omitempty"`
// TRID issued by card networks. Required only for tokenized card transactions.
TokenRequestorId *string `json:"token_requestor_id,omitempty"`
TokenType *string `json:"token_type,omitempty"`
// last 4 digits of original card number. Required only for tokenized card transactions.
CardDisplay *string `json:"card_display,omitempty"`
// Card alias as returned by Cashfree Vault API.
CardAlias *string `json:"card_alias,omitempty"`
// One of [\"Kotak\", \"ICICI\", \"RBL\", \"BOB\", \"Standard Chartered\"]. Card bank name, required for EMI payments. This is the bank user has selected for EMI
CardBankName *string `json:"card_bank_name,omitempty"`
// EMI tenure selected by the user
EmiTenure *int32 `json:"emi_tenure,omitempty"`
}
// NewCard instantiates a new Card 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 NewCard() *Card {
this := Card{}
return &this
}
// NewCardWithDefaults instantiates a new Card 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 NewCardWithDefaults() *Card {
this := Card{}
return &this
}
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *Card) GetChannel() string {
if o == nil || IsNil(o.Channel) {
var ret string
return ret
}
return *o.Channel
}
// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetChannelOk() (*string, bool) {
if o == nil || IsNil(o.Channel) {
return nil, false
}
return o.Channel, true
}
// HasChannel returns a boolean if a field has been set.
func (o *Card) HasChannel() bool {
if o != nil && !IsNil(o.Channel) {
return true
}
return false
}
// SetChannel gets a reference to the given string and assigns it to the Channel field.
func (o *Card) SetChannel(v string) {
o.Channel = &v
}
// GetCardNumber returns the CardNumber field value if set, zero value otherwise.
func (o *Card) GetCardNumber() string {
if o == nil || IsNil(o.CardNumber) {
var ret string
return ret
}
return *o.CardNumber
}
// GetCardNumberOk returns a tuple with the CardNumber field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetCardNumberOk() (*string, bool) {
if o == nil || IsNil(o.CardNumber) {
return nil, false
}
return o.CardNumber, true
}
// HasCardNumber returns a boolean if a field has been set.
func (o *Card) HasCardNumber() bool {
if o != nil && !IsNil(o.CardNumber) {
return true
}
return false
}
// SetCardNumber gets a reference to the given string and assigns it to the CardNumber field.
func (o *Card) SetCardNumber(v string) {
o.CardNumber = &v
}
// GetCardHolderName returns the CardHolderName field value if set, zero value otherwise.
func (o *Card) GetCardHolderName() string {
if o == nil || IsNil(o.CardHolderName) {
var ret string
return ret
}
return *o.CardHolderName
}
// GetCardHolderNameOk returns a tuple with the CardHolderName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetCardHolderNameOk() (*string, bool) {
if o == nil || IsNil(o.CardHolderName) {
return nil, false
}
return o.CardHolderName, true
}
// HasCardHolderName returns a boolean if a field has been set.
func (o *Card) HasCardHolderName() bool {
if o != nil && !IsNil(o.CardHolderName) {
return true
}
return false
}
// SetCardHolderName gets a reference to the given string and assigns it to the CardHolderName field.
func (o *Card) SetCardHolderName(v string) {
o.CardHolderName = &v
}
// GetCardExpiryMm returns the CardExpiryMm field value if set, zero value otherwise.
func (o *Card) GetCardExpiryMm() string {
if o == nil || IsNil(o.CardExpiryMm) {
var ret string
return ret
}
return *o.CardExpiryMm
}
// GetCardExpiryMmOk returns a tuple with the CardExpiryMm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetCardExpiryMmOk() (*string, bool) {
if o == nil || IsNil(o.CardExpiryMm) {
return nil, false
}
return o.CardExpiryMm, true
}
// HasCardExpiryMm returns a boolean if a field has been set.
func (o *Card) HasCardExpiryMm() bool {
if o != nil && !IsNil(o.CardExpiryMm) {
return true
}
return false
}
// SetCardExpiryMm gets a reference to the given string and assigns it to the CardExpiryMm field.
func (o *Card) SetCardExpiryMm(v string) {
o.CardExpiryMm = &v
}
// GetCardExpiryYy returns the CardExpiryYy field value if set, zero value otherwise.
func (o *Card) GetCardExpiryYy() string {
if o == nil || IsNil(o.CardExpiryYy) {
var ret string
return ret
}
return *o.CardExpiryYy
}
// GetCardExpiryYyOk returns a tuple with the CardExpiryYy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetCardExpiryYyOk() (*string, bool) {
if o == nil || IsNil(o.CardExpiryYy) {
return nil, false
}
return o.CardExpiryYy, true
}
// HasCardExpiryYy returns a boolean if a field has been set.
func (o *Card) HasCardExpiryYy() bool {
if o != nil && !IsNil(o.CardExpiryYy) {
return true
}
return false
}
// SetCardExpiryYy gets a reference to the given string and assigns it to the CardExpiryYy field.
func (o *Card) SetCardExpiryYy(v string) {
o.CardExpiryYy = &v
}
// GetCardCvv returns the CardCvv field value if set, zero value otherwise.
func (o *Card) GetCardCvv() string {
if o == nil || IsNil(o.CardCvv) {
var ret string
return ret
}
return *o.CardCvv
}
// GetCardCvvOk returns a tuple with the CardCvv field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetCardCvvOk() (*string, bool) {
if o == nil || IsNil(o.CardCvv) {
return nil, false
}
return o.CardCvv, true
}
// HasCardCvv returns a boolean if a field has been set.
func (o *Card) HasCardCvv() bool {
if o != nil && !IsNil(o.CardCvv) {
return true
}
return false
}
// SetCardCvv gets a reference to the given string and assigns it to the CardCvv field.
func (o *Card) SetCardCvv(v string) {
o.CardCvv = &v
}
// GetInstrumentId returns the InstrumentId field value if set, zero value otherwise.
func (o *Card) GetInstrumentId() string {
if o == nil || IsNil(o.InstrumentId) {
var ret string
return ret
}
return *o.InstrumentId
}
// GetInstrumentIdOk returns a tuple with the InstrumentId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetInstrumentIdOk() (*string, bool) {
if o == nil || IsNil(o.InstrumentId) {
return nil, false
}
return o.InstrumentId, true
}
// HasInstrumentId returns a boolean if a field has been set.
func (o *Card) HasInstrumentId() bool {
if o != nil && !IsNil(o.InstrumentId) {
return true
}
return false
}
// SetInstrumentId gets a reference to the given string and assigns it to the InstrumentId field.
func (o *Card) SetInstrumentId(v string) {
o.InstrumentId = &v
}
// GetCryptogram returns the Cryptogram field value if set, zero value otherwise.
func (o *Card) GetCryptogram() string {
if o == nil || IsNil(o.Cryptogram) {
var ret string
return ret
}
return *o.Cryptogram
}
// GetCryptogramOk returns a tuple with the Cryptogram field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetCryptogramOk() (*string, bool) {
if o == nil || IsNil(o.Cryptogram) {
return nil, false
}
return o.Cryptogram, true
}
// HasCryptogram returns a boolean if a field has been set.
func (o *Card) HasCryptogram() bool {
if o != nil && !IsNil(o.Cryptogram) {
return true
}
return false
}
// SetCryptogram gets a reference to the given string and assigns it to the Cryptogram field.
func (o *Card) SetCryptogram(v string) {
o.Cryptogram = &v
}
// GetTokenRequestorId returns the TokenRequestorId field value if set, zero value otherwise.
func (o *Card) GetTokenRequestorId() string {
if o == nil || IsNil(o.TokenRequestorId) {
var ret string
return ret
}
return *o.TokenRequestorId
}
// GetTokenRequestorIdOk returns a tuple with the TokenRequestorId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetTokenRequestorIdOk() (*string, bool) {
if o == nil || IsNil(o.TokenRequestorId) {
return nil, false
}
return o.TokenRequestorId, true
}
// HasTokenRequestorId returns a boolean if a field has been set.
func (o *Card) HasTokenRequestorId() bool {
if o != nil && !IsNil(o.TokenRequestorId) {
return true
}
return false
}
// SetTokenRequestorId gets a reference to the given string and assigns it to the TokenRequestorId field.
func (o *Card) SetTokenRequestorId(v string) {
o.TokenRequestorId = &v
}
// GetTokenType returns the TokenType field value if set, zero value otherwise.
func (o *Card) GetTokenType() string {
if o == nil || IsNil(o.TokenType) {
var ret string
return ret
}
return *o.TokenType
}
// GetTokenTypeOk returns a tuple with the TokenType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetTokenTypeOk() (*string, bool) {
if o == nil || IsNil(o.TokenType) {
return nil, false
}
return o.TokenType, true
}
// HasTokenType returns a boolean if a field has been set.
func (o *Card) HasTokenType() bool {
if o != nil && !IsNil(o.TokenType) {
return true
}
return false
}
// SetTokenType gets a reference to the given string and assigns it to the TokenType field.
func (o *Card) SetTokenType(v string) {
o.TokenType = &v
}
// GetCardDisplay returns the CardDisplay field value if set, zero value otherwise.
func (o *Card) GetCardDisplay() string {
if o == nil || IsNil(o.CardDisplay) {
var ret string
return ret
}
return *o.CardDisplay
}
// GetCardDisplayOk returns a tuple with the CardDisplay field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetCardDisplayOk() (*string, bool) {
if o == nil || IsNil(o.CardDisplay) {
return nil, false
}
return o.CardDisplay, true
}
// HasCardDisplay returns a boolean if a field has been set.
func (o *Card) HasCardDisplay() bool {
if o != nil && !IsNil(o.CardDisplay) {
return true
}
return false
}
// SetCardDisplay gets a reference to the given string and assigns it to the CardDisplay field.
func (o *Card) SetCardDisplay(v string) {
o.CardDisplay = &v
}
// GetCardAlias returns the CardAlias field value if set, zero value otherwise.
func (o *Card) GetCardAlias() string {
if o == nil || IsNil(o.CardAlias) {
var ret string
return ret
}
return *o.CardAlias
}
// GetCardAliasOk returns a tuple with the CardAlias field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetCardAliasOk() (*string, bool) {
if o == nil || IsNil(o.CardAlias) {
return nil, false
}
return o.CardAlias, true
}
// HasCardAlias returns a boolean if a field has been set.
func (o *Card) HasCardAlias() bool {
if o != nil && !IsNil(o.CardAlias) {
return true
}
return false
}
// SetCardAlias gets a reference to the given string and assigns it to the CardAlias field.
func (o *Card) SetCardAlias(v string) {
o.CardAlias = &v
}
// GetCardBankName returns the CardBankName field value if set, zero value otherwise.
func (o *Card) GetCardBankName() string {
if o == nil || IsNil(o.CardBankName) {
var ret string
return ret
}
return *o.CardBankName
}
// GetCardBankNameOk returns a tuple with the CardBankName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetCardBankNameOk() (*string, bool) {
if o == nil || IsNil(o.CardBankName) {
return nil, false
}
return o.CardBankName, true
}
// HasCardBankName returns a boolean if a field has been set.
func (o *Card) HasCardBankName() bool {
if o != nil && !IsNil(o.CardBankName) {
return true
}
return false
}
// SetCardBankName gets a reference to the given string and assigns it to the CardBankName field.
func (o *Card) SetCardBankName(v string) {
o.CardBankName = &v
}
// GetEmiTenure returns the EmiTenure field value if set, zero value otherwise.
func (o *Card) GetEmiTenure() int32 {
if o == nil || IsNil(o.EmiTenure) {
var ret int32
return ret
}
return *o.EmiTenure
}
// GetEmiTenureOk returns a tuple with the EmiTenure field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Card) GetEmiTenureOk() (*int32, bool) {
if o == nil || IsNil(o.EmiTenure) {
return nil, false
}
return o.EmiTenure, true
}
// HasEmiTenure returns a boolean if a field has been set.
func (o *Card) HasEmiTenure() bool {
if o != nil && !IsNil(o.EmiTenure) {
return true
}
return false
}
// SetEmiTenure gets a reference to the given int32 and assigns it to the EmiTenure field.
func (o *Card) SetEmiTenure(v int32) {
o.EmiTenure = &v
}
func (o Card) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Card) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
if !IsNil(o.CardNumber) {
toSerialize["card_number"] = o.CardNumber
}
if !IsNil(o.CardHolderName) {
toSerialize["card_holder_name"] = o.CardHolderName
}
if !IsNil(o.CardExpiryMm) {
toSerialize["card_expiry_mm"] = o.CardExpiryMm
}
if !IsNil(o.CardExpiryYy) {
toSerialize["card_expiry_yy"] = o.CardExpiryYy
}
if !IsNil(o.CardCvv) {
toSerialize["card_cvv"] = o.CardCvv
}
if !IsNil(o.InstrumentId) {
toSerialize["instrument_id"] = o.InstrumentId
}
if !IsNil(o.Cryptogram) {
toSerialize["cryptogram"] = o.Cryptogram
}
if !IsNil(o.TokenRequestorId) {
toSerialize["token_requestor_id"] = o.TokenRequestorId
}
if !IsNil(o.TokenType) {
toSerialize["token_type"] = o.TokenType
}
if !IsNil(o.CardDisplay) {
toSerialize["card_display"] = o.CardDisplay
}
if !IsNil(o.CardAlias) {
toSerialize["card_alias"] = o.CardAlias
}
if !IsNil(o.CardBankName) {
toSerialize["card_bank_name"] = o.CardBankName
}
if !IsNil(o.EmiTenure) {
toSerialize["emi_tenure"] = o.EmiTenure
}
return toSerialize, nil
}
type NullableCard struct {
value *Card
isSet bool
}
func (v NullableCard) Get() *Card {
return v.value
}
func (v *NullableCard) Set(val *Card) {
v.value = val
v.isSet = true
}
func (v NullableCard) IsSet() bool {
return v.isSet
}
func (v *NullableCard) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCard(val *Card) *NullableCard {
return &NullableCard{value: val, isSet: true}
}
func (v NullableCard) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCard) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}