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

fix(connector): [NETCETERA] add `sdk-type` and `default-sdk-type` in netcetera authentication request (#7156)

Sai Harsha Vardhan64a7afa6d422
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index 13014a44e0..236c0af3a3 100644
--- a/api-reference-v2/openapi_spec.json
+++ b/api-reference-v2/openapi_spec.json
@@ -19982,6 +19982,14 @@
"format": "int32",
"description": "Indicates maximum amount of time in minutes",
"minimum": 0
+ },
+ "sdk_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SdkType"
+ }
+ ],
+ "nullable": true
}
}
},
@@ -20011,6 +20019,17 @@
}
}
},
+ "SdkType": {
+ "type": "string",
+ "description": "Enum representing the type of 3DS SDK.",
+ "enum": [
+ "01",
+ "02",
+ "03",
+ "04",
+ "05"
+ ]
+ },
"SecretInfoToInitiateSdk": {
"type": "object",
"required": [
diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json
index d218e4d207..9b840f5313 100644
--- a/api-reference/openapi_spec.json
+++ b/api-reference/openapi_spec.json
@@ -24523,6 +24523,14 @@
"format": "int32",
"description": "Indicates maximum amount of time in minutes",
"minimum": 0
+ },
+ "sdk_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SdkType"
+ }
+ ],
+ "nullable": true
}
}
},
@@ -24552,6 +24560,17 @@
}
}
},
+ "SdkType": {
+ "type": "string",
+ "description": "Enum representing the type of 3DS SDK.",
+ "enum": [
+ "01",
+ "02",
+ "03",
+ "04",
+ "05"
+ ]
+ },
"SecretInfoToInitiateSdk": {
"type": "object",
"required": [
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index b6152cc978..2c0a09bf8f 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -6548,6 +6548,23 @@ pub struct SdkInformation {
pub sdk_reference_number: String,
/// Indicates maximum amount of time in minutes
pub sdk_max_timeout: u8,
+ /// Indicates the type of 3DS SDK
+ pub sdk_type: Option<SdkType>,
+}
+
+/// Enum representing the type of 3DS SDK.
+#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)]
+pub enum SdkType {
+ #[serde(rename = "01")]
+ DefaultSdk,
+ #[serde(rename = "02")]
+ SplitSdk,
+ #[serde(rename = "03")]
+ LimitedSdk,
+ #[serde(rename = "04")]
+ BrowserSdk,
+ #[serde(rename = "05")]
+ ShellSdk,
}
#[cfg(feature = "v2")]
diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs
index 3a634ae2a5..de358f7933 100644
--- a/crates/openapi/src/openapi.rs
+++ b/crates/openapi/src/openapi.rs
@@ -653,6 +653,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::PaymentChargeType,
api_models::enums::StripeChargeType,
api_models::payments::CustomerDetailsResponse,
+ api_models::payments::SdkType,
api_models::payments::OpenBankingData,
api_models::payments::OpenBankingSessionToken,
api_models::payments::BankDebitResponse,
diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs
index 3b1fefefa1..701fb22d1a 100644
--- a/crates/openapi/src/openapi_v2.rs
+++ b/crates/openapi/src/openapi_v2.rs
@@ -328,6 +328,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::BankRedirectBilling,
api_models::payments::ConnectorMetadata,
api_models::payments::FeatureMetadata,
+ api_models::payments::SdkType,
api_models::payments::ApplepayConnectorMetadataRequest,
api_models::payments::SessionTokenInfo,
api_models::payments::PaymentProcessingDetailsAt,
diff --git a/crates/router/src/connector/netcetera/netcetera_types.rs b/crates/router/src/connector/netcetera/netcetera_types.rs
index 0ecbbf63e3..36daa62e55 100644
--- a/crates/router/src/connector/netcetera/netcetera_types.rs
+++ b/crates/router/src/connector/netcetera/netcetera_types.rs
@@ -1538,7 +1538,7 @@ pub struct Sdk {
///
/// This field is required for requests where deviceChannel = 01 (APP).
/// Available for supporting EMV 3DS 2.3.1 and later versions.
- sdk_type: Option<SdkTypeEnum>,
+ sdk_type: Option<SdkType>,
/// Indicates the characteristics of a Default-SDK.
///
@@ -1563,16 +1563,35 @@ impl From<api_models::payments::SdkInformation> for Sdk {
sdk_reference_number: Some(sdk_info.sdk_reference_number),
sdk_trans_id: Some(sdk_info.sdk_trans_id),
sdk_server_signed_content: None,
- sdk_type: None,
- default_sdk_type: None,
+ sdk_type: sdk_info
+ .sdk_type
+ .map(SdkType::from)
+ .or(Some(SdkType::DefaultSdk)),
+ default_sdk_type: Some(DefaultSdkType {
+ // hardcoding this value because, it's the only value that is accepted
+ sdk_variant: "01".to_string(),
+ wrapped_ind: None,
+ }),
split_sdk_type: None,
}
}
}
+impl From<api_models::payments::SdkType> for SdkType {
+ fn from(sdk_type: api_models::payments::SdkType) -> Self {
+ match sdk_type {
+ api_models::payments::SdkType::DefaultSdk => Self::DefaultSdk,
+ api_models::payments::SdkType::SplitSdk => Self::SplitSdk,
+ api_models::payments::SdkType::LimitedSdk => Self::LimitedSdk,
+ api_models::payments::SdkType::BrowserSdk => Self::BrowserSdk,
+ api_models::payments::SdkType::ShellSdk => Self::ShellSdk,
+ }
+ }
+}
+
/// Enum representing the type of 3DS SDK.
#[derive(Serialize, Deserialize, Debug, Clone)]
-pub enum SdkTypeEnum {
+pub enum SdkType {
#[serde(rename = "01")]
DefaultSdk,
#[serde(rename = "02")]