1
- use common_utils:: encryption:: Encryption ;
1
+ use common_utils:: { encryption:: Encryption , pii } ;
2
2
use diesel:: { AsChangeset , Identifiable , Insertable , Queryable , Selectable } ;
3
3
use serde:: { self , Deserialize , Serialize } ;
4
4
use serde_json;
@@ -61,6 +61,10 @@ pub struct Authentication {
61
61
pub browser_info : Option < serde_json:: Value > ,
62
62
pub email : Option < Encryption > ,
63
63
pub profile_acquirer_id : Option < common_utils:: id_type:: ProfileAcquirerId > ,
64
+ pub challenge_code : Option < String > ,
65
+ pub challenge_cancel : Option < String > ,
66
+ pub challenge_code_reason : Option < String > ,
67
+ pub message_extension : Option < pii:: SecretSerdeValue > ,
64
68
}
65
69
66
70
impl Authentication {
@@ -121,6 +125,10 @@ pub struct AuthenticationNew {
121
125
pub browser_info : Option < serde_json:: Value > ,
122
126
pub email : Option < Encryption > ,
123
127
pub profile_acquirer_id : Option < common_utils:: id_type:: ProfileAcquirerId > ,
128
+ pub challenge_code : Option < String > ,
129
+ pub challenge_cancel : Option < String > ,
130
+ pub challenge_code_reason : Option < String > ,
131
+ pub message_extension : Option < pii:: SecretSerdeValue > ,
124
132
}
125
133
126
134
#[ derive( Debug ) ]
@@ -167,11 +175,17 @@ pub enum AuthenticationUpdate {
167
175
authentication_status : common_enums:: AuthenticationStatus ,
168
176
ds_trans_id : Option < String > ,
169
177
eci : Option < String > ,
178
+ challenge_code : Option < String > ,
179
+ challenge_cancel : Option < String > ,
180
+ challenge_code_reason : Option < String > ,
181
+ message_extension : Option < pii:: SecretSerdeValue > ,
170
182
} ,
171
183
PostAuthenticationUpdate {
172
184
trans_status : common_enums:: TransactionStatus ,
173
185
eci : Option < String > ,
174
186
authentication_status : common_enums:: AuthenticationStatus ,
187
+ challenge_cancel : Option < String > ,
188
+ challenge_code_reason : Option < String > ,
175
189
} ,
176
190
ErrorUpdate {
177
191
error_message : Option < String > ,
@@ -227,6 +241,10 @@ pub struct AuthenticationUpdateInternal {
227
241
pub browser_info : Option < serde_json:: Value > ,
228
242
pub email : Option < Encryption > ,
229
243
pub profile_acquirer_id : Option < common_utils:: id_type:: ProfileAcquirerId > ,
244
+ pub challenge_code : Option < String > ,
245
+ pub challenge_cancel : Option < String > ,
246
+ pub challenge_code_reason : Option < String > ,
247
+ pub message_extension : Option < pii:: SecretSerdeValue > ,
230
248
}
231
249
232
250
impl Default for AuthenticationUpdateInternal {
@@ -267,6 +285,10 @@ impl Default for AuthenticationUpdateInternal {
267
285
browser_info : Default :: default ( ) ,
268
286
email : Default :: default ( ) ,
269
287
profile_acquirer_id : Default :: default ( ) ,
288
+ challenge_code : Default :: default ( ) ,
289
+ challenge_cancel : Default :: default ( ) ,
290
+ challenge_code_reason : Default :: default ( ) ,
291
+ message_extension : Default :: default ( ) ,
270
292
}
271
293
}
272
294
}
@@ -309,6 +331,10 @@ impl AuthenticationUpdateInternal {
309
331
browser_info,
310
332
email,
311
333
profile_acquirer_id,
334
+ challenge_code,
335
+ challenge_cancel,
336
+ challenge_code_reason,
337
+ message_extension,
312
338
} = self ;
313
339
Authentication {
314
340
connector_authentication_id : connector_authentication_id
@@ -350,6 +376,10 @@ impl AuthenticationUpdateInternal {
350
376
browser_info : browser_info. or ( source. browser_info ) ,
351
377
email : email. or ( source. email ) ,
352
378
profile_acquirer_id : profile_acquirer_id. or ( source. profile_acquirer_id ) ,
379
+ challenge_code : challenge_code. or ( source. challenge_code ) ,
380
+ challenge_cancel : challenge_cancel. or ( source. challenge_cancel ) ,
381
+ challenge_code_reason : challenge_code_reason. or ( source. challenge_code_reason ) ,
382
+ message_extension : message_extension. or ( source. message_extension ) ,
353
383
..source
354
384
}
355
385
}
@@ -438,6 +468,10 @@ impl From<AuthenticationUpdate> for AuthenticationUpdateInternal {
438
468
authentication_status,
439
469
ds_trans_id,
440
470
eci,
471
+ challenge_code,
472
+ challenge_cancel,
473
+ challenge_code_reason,
474
+ message_extension,
441
475
} => Self {
442
476
trans_status : Some ( trans_status) ,
443
477
authentication_type : Some ( authentication_type) ,
@@ -450,16 +484,24 @@ impl From<AuthenticationUpdate> for AuthenticationUpdateInternal {
450
484
authentication_status : Some ( authentication_status) ,
451
485
ds_trans_id,
452
486
eci,
487
+ challenge_code,
488
+ challenge_cancel,
489
+ challenge_code_reason,
490
+ message_extension,
453
491
..Default :: default ( )
454
492
} ,
455
493
AuthenticationUpdate :: PostAuthenticationUpdate {
456
494
trans_status,
457
495
eci,
458
496
authentication_status,
497
+ challenge_cancel,
498
+ challenge_code_reason,
459
499
} => Self {
460
500
trans_status : Some ( trans_status) ,
461
501
eci,
462
502
authentication_status : Some ( authentication_status) ,
503
+ challenge_cancel,
504
+ challenge_code_reason,
463
505
..Default :: default ( )
464
506
} ,
465
507
AuthenticationUpdate :: PreAuthenticationVersionCallUpdate {
0 commit comments