Skip to content

Commit 2129558

Browse files
Debarati GhatakDebarati Ghatak
authored andcommitted
feat(core): add additional fields to authentication table
1 parent 7b9f486 commit 2129558

File tree

27 files changed

+325
-57
lines changed

27 files changed

+325
-57
lines changed

crates/diesel_models/src/authentication.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ pub struct Authentication {
6161
pub browser_info: Option<serde_json::Value>,
6262
pub email: Option<Encryption>,
6363
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<serde_json::Value>,
6468
}
6569

6670
impl Authentication {
@@ -121,6 +125,10 @@ pub struct AuthenticationNew {
121125
pub browser_info: Option<serde_json::Value>,
122126
pub email: Option<Encryption>,
123127
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<serde_json::Value>,
124132
}
125133

126134
#[derive(Debug)]
@@ -167,11 +175,17 @@ pub enum AuthenticationUpdate {
167175
authentication_status: common_enums::AuthenticationStatus,
168176
ds_trans_id: Option<String>,
169177
eci: Option<String>,
178+
challenge_code: Option<String>,
179+
challenge_cancel: Option<String>,
180+
challenge_code_reason: Option<String>,
181+
message_extension: Option<serde_json::Value>,
170182
},
171183
PostAuthenticationUpdate {
172184
trans_status: common_enums::TransactionStatus,
173185
eci: Option<String>,
174186
authentication_status: common_enums::AuthenticationStatus,
187+
challenge_cancel: Option<String>,
188+
challenge_code_reason: Option<String>,
175189
},
176190
ErrorUpdate {
177191
error_message: Option<String>,
@@ -227,6 +241,10 @@ pub struct AuthenticationUpdateInternal {
227241
pub browser_info: Option<serde_json::Value>,
228242
pub email: Option<Encryption>,
229243
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<serde_json::Value>,
230248
}
231249

232250
impl Default for AuthenticationUpdateInternal {
@@ -267,6 +285,10 @@ impl Default for AuthenticationUpdateInternal {
267285
browser_info: Default::default(),
268286
email: Default::default(),
269287
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(),
270292
}
271293
}
272294
}
@@ -309,6 +331,10 @@ impl AuthenticationUpdateInternal {
309331
browser_info,
310332
email,
311333
profile_acquirer_id,
334+
challenge_code,
335+
challenge_cancel,
336+
challenge_code_reason,
337+
message_extension,
312338
} = self;
313339
Authentication {
314340
connector_authentication_id: connector_authentication_id
@@ -350,6 +376,10 @@ impl AuthenticationUpdateInternal {
350376
browser_info: browser_info.or(source.browser_info),
351377
email: email.or(source.email),
352378
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),
353383
..source
354384
}
355385
}
@@ -438,6 +468,10 @@ impl From<AuthenticationUpdate> for AuthenticationUpdateInternal {
438468
authentication_status,
439469
ds_trans_id,
440470
eci,
471+
challenge_code,
472+
challenge_cancel,
473+
challenge_code_reason,
474+
message_extension,
441475
} => Self {
442476
trans_status: Some(trans_status),
443477
authentication_type: Some(authentication_type),
@@ -450,16 +484,24 @@ impl From<AuthenticationUpdate> for AuthenticationUpdateInternal {
450484
authentication_status: Some(authentication_status),
451485
ds_trans_id,
452486
eci,
487+
challenge_code,
488+
challenge_cancel,
489+
challenge_code_reason,
490+
message_extension,
453491
..Default::default()
454492
},
455493
AuthenticationUpdate::PostAuthenticationUpdate {
456494
trans_status,
457495
eci,
458496
authentication_status,
497+
challenge_cancel,
498+
challenge_code_reason,
459499
} => Self {
460500
trans_status: Some(trans_status),
461501
eci,
462502
authentication_status: Some(authentication_status),
503+
challenge_cancel,
504+
challenge_code_reason,
463505
..Default::default()
464506
},
465507
AuthenticationUpdate::PreAuthenticationVersionCallUpdate {

crates/diesel_models/src/schema.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ diesel::table! {
137137
email -> Nullable<Bytea>,
138138
#[max_length = 128]
139139
profile_acquirer_id -> Nullable<Varchar>,
140+
challenge_code -> Nullable<Varchar>,
141+
challenge_cancel -> Nullable<Varchar>,
142+
challenge_code_reason -> Nullable<Varchar>,
143+
message_extension -> Nullable<Jsonb>,
140144
}
141145
}
142146

crates/diesel_models/src/schema_v2.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ diesel::table! {
137137
email -> Nullable<Bytea>,
138138
#[max_length = 128]
139139
profile_acquirer_id -> Nullable<Varchar>,
140+
challenge_code-> Nullable<Varchar>,
141+
challenge_cancel-> Nullable<Varchar>,
142+
challenge_code_reason-> Nullable<Varchar>,
143+
message_extension->Nullable<Jsonb>,
140144
}
141145
}
142146

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"preferredProtocolVersion": String("2.3.1"), "enforcePreferredProtocolVersion": Bool(false), "deviceChannel": String("02"), "messageCategory": String("01"), "threeDSCompInd": String("Y"), "threeDSMethodId": Null, "threeDSRequestor": Object {"threeDSRequestorAuthenticationInd": String("01"), "threeDSRequestorAuthenticationInfo": Null, "threeDSRequestorChallengeInd": Array [String("04")], "threeDSRequestorPriorAuthenticationInfo": Null, "threeDSRequestorDecReqInd": Null, "threeDSRequestorDecMaxTime": Null, "appIp": String("::1"), "threeDSRequestorSpcSupport": Null, "spcIncompInd": Null}, "threeDSServerTransID": String("86d974d0-d278-4b28-bbea-df45824dab7f"), "threeDSRequestorURL": String("https://google.com"), "cardholderAccount": Object {"acctType": Null, "cardExpiryDate": String("*** alloc::string::String ***"), "acctInfo": Null, "acctNumber": String("530688**********"), "schemeId": Null, "acctID": Null, "payTokenInd": Null, "payTokenInfo": Null, "cardSecurityCode": String("*** alloc::string::String ***")}, "cardholder": Object {"addrMatch": Null, "billAddrCity": String("San Fransico"), "billAddrCountry": String("840"), "billAddrLine1": String("*** alloc::string::String ***"), "billAddrLine2": Null, "billAddrLine3": Null, "billAddrPostCode": String("*** alloc::string::String ***"), "billAddrState": String("*** alloc::string::String ***"), "email": String("***********************@gmail.com"), "homePhone": Null, "mobilePhone": Null, "workPhone": Null, "cardholderName": String("*** alloc::string::String ***"), "shipAddrCity": String("San Fransico"), "shipAddrCountry": String("840"), "shipAddrLine1": String("*** alloc::string::String ***"), "shipAddrLine2": String("*** alloc::string::String ***"), "shipAddrLine3": String("*** alloc::string::String ***"), "shipAddrPostCode": String("*** alloc::string::String ***"), "shipAddrState": String("*** alloc::string::String ***"), "taxId": Null}, "purchase": Object {"purchaseInstalData": Null, "merchantRiskIndicator": Null, "purchaseAmount": Number(2999), "purchaseCurrency": String("840"), "purchaseExponent": Number(2), "purchaseDate": String("20250730153807"), "recurringExpiry": Null, "recurringFrequency": Null, "transType": String("01"), "recurringAmount": Null, "recurringCurrency": Null, "recurringExponent": Null, "recurringDate": Null, "amountInd": Null, "frequencyInd": Null}, "acquirer": Object {"acquirerBin": String("518422"), "acquirerMerchantId": String("fb_merchant_test"), "acquirerCountryCode": String("840")}, "merchant": Object {"merchantConfigurationId": String("fb001"), "notificationURL": String("https://46bf543f8d68.ngrok-free.app/payments/pay_z8Lf6UTgmBuDUUDEeILg/merchant_1753888741/authorize/cybersource"), "whiteListStatus": Null, "trustListStatus": Null, "sellerInfo": Null, "resultsResponseNotificationUrl": String("https://46bf543f8d68.ngrok-free.app/webhooks/merchant_1753888741/mca_cMQw7PtxMAsLo50WsxIe")}, "broadInfo": Null, "deviceRenderOptions": Null, "messageExtension": Null, "challengeMessageExtension": Null, "browserInformation": Object {"browserAcceptHeader": String("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"), "browserIP": String("*** alloc::string::String ***"), "browserJavaEnabled": Bool(true), "browserLanguage": String("en-US"), "browserColorDepth": String("24"), "browserScreenHeight": Number(1117), "browserScreenWidth": Number(1728), "browserTZ": Number(-330), "browserUserAgent": String("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"), "challengeWindowSize": String("05"), "browserJavascriptEnabled": Bool(true), "acceptLanguage": Array [String("en-US"), String("en")]}, "threeRIInd": Null, "sdkInformation": Null, "device": Null, "multiTransaction": Null, "deviceId": Null, "userId": Null, "payeeOrigin": Null}

0 commit comments

Comments
 (0)