-
Notifications
You must be signed in to change notification settings - Fork 28
/
model_authentication_info.go
608 lines (524 loc) · 19 KB
/
model_authentication_info.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
607
608
/*
Authentication webhooks
API version: 1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package acswebhook
import (
"encoding/json"
"time"
"github.com/adyen/adyen-go-api-library/v16/src/common"
)
// checks if the AuthenticationInfo type satisfies the MappedNullable interface at compile time
var _ common.MappedNullable = &AuthenticationInfo{}
// AuthenticationInfo struct for AuthenticationInfo
type AuthenticationInfo struct {
// Universally unique transaction identifier assigned by the Access Control Server (ACS) to identify a single transaction.
AcsTransId string `json:"acsTransId"`
Challenge *ChallengeInfo `json:"challenge,omitempty"`
// Specifies a preference for receiving a challenge. Possible values: * **01**: No preference * **02**: No challenge requested * **03**: Challenge requested (preference) * **04**: Challenge requested (mandate) * **05**: No challenge requested (transactional risk analysis is already performed) * **07**: No challenge requested (SCA is already performed) * **08**: No challenge requested (trusted beneficiaries exemption of no challenge required) * **09**: Challenge requested (trusted beneficiaries prompt requested if challenge required) * **80**: No challenge requested (secure corporate payment with Mastercard) * **82**: No challenge requested (secure corporate payment with Visa)
ChallengeIndicator string `json:"challengeIndicator"`
// Date and time in UTC of the cardholder authentication. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.
CreatedAt time.Time `json:"createdAt"`
// Indicates the type of channel interface being used to initiate the transaction. Possible values: * **app** * **browser** * **3DSRequestorInitiated** (initiated by a merchant when the cardholder is not available)
DeviceChannel string `json:"deviceChannel"`
// Universally unique transaction identifier assigned by the DS (card scheme) to identify a single transaction.
DsTransID string `json:"dsTransID"`
// Indicates the exemption type that was applied to the authentication by the issuer, if exemption applied. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** * **acquirerExemption** * **noExemptionApplied** * **visaDAFExemption**
ExemptionIndicator *string `json:"exemptionIndicator,omitempty"`
// Indicates if the purchase was in the PSD2 scope.
InPSD2Scope bool `json:"inPSD2Scope"`
// Identifies the category of the message for a specific use case. Possible values: * **payment** * **nonPayment**
MessageCategory string `json:"messageCategory"`
// The `messageVersion` value as defined in the 3D Secure 2 specification.
MessageVersion string `json:"messageVersion"`
// Risk score calculated from the transaction rules.
RiskScore *int32 `json:"riskScore,omitempty"`
// The `threeDSServerTransID` value as defined in the 3D Secure 2 specification.
ThreeDSServerTransID string `json:"threeDSServerTransID"`
// The `transStatus` value as defined in the 3D Secure 2 specification. Possible values: * **Y**: Authentication / Account verification successful. * **N**: Not Authenticated / Account not verified. Transaction denied. * **U**: Authentication / Account verification could not be performed. * **I**: Informational Only / 3D Secure Requestor challenge preference acknowledged. * **R**: Authentication / Account verification rejected by the Issuer.
TransStatus string `json:"transStatus"`
// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values).
TransStatusReason *string `json:"transStatusReason,omitempty"`
// The type of authentication performed. Possible values: * **frictionless** * **challenge**
Type string `json:"type"`
}
// NewAuthenticationInfo instantiates a new AuthenticationInfo 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 NewAuthenticationInfo(acsTransId string, challengeIndicator string, createdAt time.Time, deviceChannel string, dsTransID string, inPSD2Scope bool, messageCategory string, messageVersion string, threeDSServerTransID string, transStatus string, type_ string) *AuthenticationInfo {
this := AuthenticationInfo{}
this.AcsTransId = acsTransId
this.ChallengeIndicator = challengeIndicator
this.CreatedAt = createdAt
this.DeviceChannel = deviceChannel
this.DsTransID = dsTransID
this.InPSD2Scope = inPSD2Scope
this.MessageCategory = messageCategory
this.MessageVersion = messageVersion
this.ThreeDSServerTransID = threeDSServerTransID
this.TransStatus = transStatus
this.Type = type_
return &this
}
// NewAuthenticationInfoWithDefaults instantiates a new AuthenticationInfo 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 NewAuthenticationInfoWithDefaults() *AuthenticationInfo {
this := AuthenticationInfo{}
return &this
}
// GetAcsTransId returns the AcsTransId field value
func (o *AuthenticationInfo) GetAcsTransId() string {
if o == nil {
var ret string
return ret
}
return o.AcsTransId
}
// GetAcsTransIdOk returns a tuple with the AcsTransId field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetAcsTransIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.AcsTransId, true
}
// SetAcsTransId sets field value
func (o *AuthenticationInfo) SetAcsTransId(v string) {
o.AcsTransId = v
}
// GetChallenge returns the Challenge field value if set, zero value otherwise.
func (o *AuthenticationInfo) GetChallenge() ChallengeInfo {
if o == nil || common.IsNil(o.Challenge) {
var ret ChallengeInfo
return ret
}
return *o.Challenge
}
// GetChallengeOk returns a tuple with the Challenge field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetChallengeOk() (*ChallengeInfo, bool) {
if o == nil || common.IsNil(o.Challenge) {
return nil, false
}
return o.Challenge, true
}
// HasChallenge returns a boolean if a field has been set.
func (o *AuthenticationInfo) HasChallenge() bool {
if o != nil && !common.IsNil(o.Challenge) {
return true
}
return false
}
// SetChallenge gets a reference to the given ChallengeInfo and assigns it to the Challenge field.
func (o *AuthenticationInfo) SetChallenge(v ChallengeInfo) {
o.Challenge = &v
}
// GetChallengeIndicator returns the ChallengeIndicator field value
func (o *AuthenticationInfo) GetChallengeIndicator() string {
if o == nil {
var ret string
return ret
}
return o.ChallengeIndicator
}
// GetChallengeIndicatorOk returns a tuple with the ChallengeIndicator field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetChallengeIndicatorOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ChallengeIndicator, true
}
// SetChallengeIndicator sets field value
func (o *AuthenticationInfo) SetChallengeIndicator(v string) {
o.ChallengeIndicator = v
}
// GetCreatedAt returns the CreatedAt field value
func (o *AuthenticationInfo) GetCreatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetCreatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *AuthenticationInfo) SetCreatedAt(v time.Time) {
o.CreatedAt = v
}
// GetDeviceChannel returns the DeviceChannel field value
func (o *AuthenticationInfo) GetDeviceChannel() string {
if o == nil {
var ret string
return ret
}
return o.DeviceChannel
}
// GetDeviceChannelOk returns a tuple with the DeviceChannel field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetDeviceChannelOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DeviceChannel, true
}
// SetDeviceChannel sets field value
func (o *AuthenticationInfo) SetDeviceChannel(v string) {
o.DeviceChannel = v
}
// GetDsTransID returns the DsTransID field value
func (o *AuthenticationInfo) GetDsTransID() string {
if o == nil {
var ret string
return ret
}
return o.DsTransID
}
// GetDsTransIDOk returns a tuple with the DsTransID field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetDsTransIDOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DsTransID, true
}
// SetDsTransID sets field value
func (o *AuthenticationInfo) SetDsTransID(v string) {
o.DsTransID = v
}
// GetExemptionIndicator returns the ExemptionIndicator field value if set, zero value otherwise.
func (o *AuthenticationInfo) GetExemptionIndicator() string {
if o == nil || common.IsNil(o.ExemptionIndicator) {
var ret string
return ret
}
return *o.ExemptionIndicator
}
// GetExemptionIndicatorOk returns a tuple with the ExemptionIndicator field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetExemptionIndicatorOk() (*string, bool) {
if o == nil || common.IsNil(o.ExemptionIndicator) {
return nil, false
}
return o.ExemptionIndicator, true
}
// HasExemptionIndicator returns a boolean if a field has been set.
func (o *AuthenticationInfo) HasExemptionIndicator() bool {
if o != nil && !common.IsNil(o.ExemptionIndicator) {
return true
}
return false
}
// SetExemptionIndicator gets a reference to the given string and assigns it to the ExemptionIndicator field.
func (o *AuthenticationInfo) SetExemptionIndicator(v string) {
o.ExemptionIndicator = &v
}
// GetInPSD2Scope returns the InPSD2Scope field value
func (o *AuthenticationInfo) GetInPSD2Scope() bool {
if o == nil {
var ret bool
return ret
}
return o.InPSD2Scope
}
// GetInPSD2ScopeOk returns a tuple with the InPSD2Scope field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetInPSD2ScopeOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.InPSD2Scope, true
}
// SetInPSD2Scope sets field value
func (o *AuthenticationInfo) SetInPSD2Scope(v bool) {
o.InPSD2Scope = v
}
// GetMessageCategory returns the MessageCategory field value
func (o *AuthenticationInfo) GetMessageCategory() string {
if o == nil {
var ret string
return ret
}
return o.MessageCategory
}
// GetMessageCategoryOk returns a tuple with the MessageCategory field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetMessageCategoryOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MessageCategory, true
}
// SetMessageCategory sets field value
func (o *AuthenticationInfo) SetMessageCategory(v string) {
o.MessageCategory = v
}
// GetMessageVersion returns the MessageVersion field value
func (o *AuthenticationInfo) GetMessageVersion() string {
if o == nil {
var ret string
return ret
}
return o.MessageVersion
}
// GetMessageVersionOk returns a tuple with the MessageVersion field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetMessageVersionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MessageVersion, true
}
// SetMessageVersion sets field value
func (o *AuthenticationInfo) SetMessageVersion(v string) {
o.MessageVersion = v
}
// GetRiskScore returns the RiskScore field value if set, zero value otherwise.
func (o *AuthenticationInfo) GetRiskScore() int32 {
if o == nil || common.IsNil(o.RiskScore) {
var ret int32
return ret
}
return *o.RiskScore
}
// GetRiskScoreOk returns a tuple with the RiskScore field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetRiskScoreOk() (*int32, bool) {
if o == nil || common.IsNil(o.RiskScore) {
return nil, false
}
return o.RiskScore, true
}
// HasRiskScore returns a boolean if a field has been set.
func (o *AuthenticationInfo) HasRiskScore() bool {
if o != nil && !common.IsNil(o.RiskScore) {
return true
}
return false
}
// SetRiskScore gets a reference to the given int32 and assigns it to the RiskScore field.
func (o *AuthenticationInfo) SetRiskScore(v int32) {
o.RiskScore = &v
}
// GetThreeDSServerTransID returns the ThreeDSServerTransID field value
func (o *AuthenticationInfo) GetThreeDSServerTransID() string {
if o == nil {
var ret string
return ret
}
return o.ThreeDSServerTransID
}
// GetThreeDSServerTransIDOk returns a tuple with the ThreeDSServerTransID field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetThreeDSServerTransIDOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ThreeDSServerTransID, true
}
// SetThreeDSServerTransID sets field value
func (o *AuthenticationInfo) SetThreeDSServerTransID(v string) {
o.ThreeDSServerTransID = v
}
// GetTransStatus returns the TransStatus field value
func (o *AuthenticationInfo) GetTransStatus() string {
if o == nil {
var ret string
return ret
}
return o.TransStatus
}
// GetTransStatusOk returns a tuple with the TransStatus field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetTransStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TransStatus, true
}
// SetTransStatus sets field value
func (o *AuthenticationInfo) SetTransStatus(v string) {
o.TransStatus = v
}
// GetTransStatusReason returns the TransStatusReason field value if set, zero value otherwise.
func (o *AuthenticationInfo) GetTransStatusReason() string {
if o == nil || common.IsNil(o.TransStatusReason) {
var ret string
return ret
}
return *o.TransStatusReason
}
// GetTransStatusReasonOk returns a tuple with the TransStatusReason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetTransStatusReasonOk() (*string, bool) {
if o == nil || common.IsNil(o.TransStatusReason) {
return nil, false
}
return o.TransStatusReason, true
}
// HasTransStatusReason returns a boolean if a field has been set.
func (o *AuthenticationInfo) HasTransStatusReason() bool {
if o != nil && !common.IsNil(o.TransStatusReason) {
return true
}
return false
}
// SetTransStatusReason gets a reference to the given string and assigns it to the TransStatusReason field.
func (o *AuthenticationInfo) SetTransStatusReason(v string) {
o.TransStatusReason = &v
}
// GetType returns the Type field value
func (o *AuthenticationInfo) GetType() string {
if o == nil {
var ret string
return ret
}
return o.Type
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *AuthenticationInfo) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value
func (o *AuthenticationInfo) SetType(v string) {
o.Type = v
}
func (o AuthenticationInfo) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AuthenticationInfo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["acsTransId"] = o.AcsTransId
if !common.IsNil(o.Challenge) {
toSerialize["challenge"] = o.Challenge
}
toSerialize["challengeIndicator"] = o.ChallengeIndicator
toSerialize["createdAt"] = o.CreatedAt
toSerialize["deviceChannel"] = o.DeviceChannel
toSerialize["dsTransID"] = o.DsTransID
if !common.IsNil(o.ExemptionIndicator) {
toSerialize["exemptionIndicator"] = o.ExemptionIndicator
}
toSerialize["inPSD2Scope"] = o.InPSD2Scope
toSerialize["messageCategory"] = o.MessageCategory
toSerialize["messageVersion"] = o.MessageVersion
if !common.IsNil(o.RiskScore) {
toSerialize["riskScore"] = o.RiskScore
}
toSerialize["threeDSServerTransID"] = o.ThreeDSServerTransID
toSerialize["transStatus"] = o.TransStatus
if !common.IsNil(o.TransStatusReason) {
toSerialize["transStatusReason"] = o.TransStatusReason
}
toSerialize["type"] = o.Type
return toSerialize, nil
}
type NullableAuthenticationInfo struct {
value *AuthenticationInfo
isSet bool
}
func (v NullableAuthenticationInfo) Get() *AuthenticationInfo {
return v.value
}
func (v *NullableAuthenticationInfo) Set(val *AuthenticationInfo) {
v.value = val
v.isSet = true
}
func (v NullableAuthenticationInfo) IsSet() bool {
return v.isSet
}
func (v *NullableAuthenticationInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAuthenticationInfo(val *AuthenticationInfo) *NullableAuthenticationInfo {
return &NullableAuthenticationInfo{value: val, isSet: true}
}
func (v NullableAuthenticationInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAuthenticationInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
func (o *AuthenticationInfo) isValidChallengeIndicator() bool {
var allowedEnumValues = []string{"01", "02", "03", "04", "05", "07", "08", "09", "80", "82"}
for _, allowed := range allowedEnumValues {
if o.GetChallengeIndicator() == allowed {
return true
}
}
return false
}
func (o *AuthenticationInfo) isValidDeviceChannel() bool {
var allowedEnumValues = []string{"app", "browser", "ThreeDSRequestorInitiated"}
for _, allowed := range allowedEnumValues {
if o.GetDeviceChannel() == allowed {
return true
}
}
return false
}
func (o *AuthenticationInfo) isValidExemptionIndicator() bool {
var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis", "acquirerExemption", "noExemptionApplied", "visaDAFExemption"}
for _, allowed := range allowedEnumValues {
if o.GetExemptionIndicator() == allowed {
return true
}
}
return false
}
func (o *AuthenticationInfo) isValidMessageCategory() bool {
var allowedEnumValues = []string{"payment", "nonPayment"}
for _, allowed := range allowedEnumValues {
if o.GetMessageCategory() == allowed {
return true
}
}
return false
}
func (o *AuthenticationInfo) isValidTransStatus() bool {
var allowedEnumValues = []string{"Y", "N", "R", "I", "U"}
for _, allowed := range allowedEnumValues {
if o.GetTransStatus() == allowed {
return true
}
}
return false
}
func (o *AuthenticationInfo) isValidTransStatusReason() bool {
var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "80", "81", "82", "83", "84", "85", "86", "87", "88"}
for _, allowed := range allowedEnumValues {
if o.GetTransStatusReason() == allowed {
return true
}
}
return false
}
func (o *AuthenticationInfo) isValidType() bool {
var allowedEnumValues = []string{"frictionless", "challenge"}
for _, allowed := range allowedEnumValues {
if o.GetType() == allowed {
return true
}
}
return false
}