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