Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
},
Expand Down Expand Up @@ -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": [
Expand Down
17 changes: 17 additions & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
1 change: 1 addition & 0 deletions crates/openapi/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
23 changes: 21 additions & 2 deletions crates/router/src/connector/netcetera/netcetera_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1563,13 +1563,32 @@ 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(SdkTypeEnum::from)
.or(Some(SdkTypeEnum::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::SdkTypeEnum> for SdkTypeEnum {
fn from(sdk_type: api_models::payments::SdkTypeEnum) -> Self {
match sdk_type {
api_models::payments::SdkTypeEnum::DefaultSdk => Self::DefaultSdk,
api_models::payments::SdkTypeEnum::SplitSdk => Self::SplitSdk,
api_models::payments::SdkTypeEnum::LimitedSdk => Self::LimitedSdk,
api_models::payments::SdkTypeEnum::BrowserSdk => Self::BrowserSdk,
api_models::payments::SdkTypeEnum::ShellSdk => Self::ShellSdk,
}
}
}

/// Enum representing the type of 3DS SDK.
#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum SdkTypeEnum {
Expand Down
Loading