Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor: [Netcetera] Handle response deserialization error (#8988)

Swangi Kumari08166991f814
diff --git a/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs b/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs
index 8444c7b9dd..b6e85aea3c 100644
--- a/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs
@@ -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 {