mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
refactor: [Netcetera] Handle response deserialization error (#8988)
This commit is contained in:
@ -163,7 +163,10 @@ impl
|
||||
.authentication_request
|
||||
.as_ref()
|
||||
.and_then(|req| req.three_ds_requestor_challenge_ind.as_ref())
|
||||
.and_then(|v| v.first().cloned());
|
||||
.and_then(|ind| match ind {
|
||||
ThreedsRequestorChallengeInd::Single(s) => Some(s.clone()),
|
||||
ThreedsRequestorChallengeInd::Multiple(v) => v.first().cloned(),
|
||||
});
|
||||
|
||||
let message_extension = response
|
||||
.authentication_request
|
||||
@ -680,10 +683,17 @@ pub struct NetceteraAuthenticationFailureResponse {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AuthenticationRequest {
|
||||
#[serde(rename = "threeDSRequestorChallengeInd")]
|
||||
pub three_ds_requestor_challenge_ind: Option<Vec<String>>,
|
||||
pub three_ds_requestor_challenge_ind: Option<ThreedsRequestorChallengeInd>,
|
||||
pub message_extension: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum ThreedsRequestorChallengeInd {
|
||||
Single(String),
|
||||
Multiple(Vec<String>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AuthenticationResponse {
|
||||
|
||||
Reference in New Issue
Block a user