feat(core): Add support for card network tokenization (#5599)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prasunna Soppa
2024-09-16 16:43:15 +05:30
committed by GitHub
parent 90ebd54ec9
commit 61e2ca9b17
63 changed files with 2369 additions and 224 deletions

View File

@ -1917,6 +1917,11 @@ pub struct BusinessProfileCreate {
/// If set to `true` tax_connector_id will be checked.
#[serde(default)]
pub is_tax_connector_enabled: bool,
/// Indicates if is_network_tokenization_enabled is enabled or not.
/// If set to `true` is_network_tokenization_enabled will be checked.
#[serde(default)]
pub is_network_tokenization_enabled: bool,
}
#[nutype::nutype(
@ -2021,6 +2026,11 @@ pub struct BusinessProfileCreate {
/// If set to `true` tax_connector_id will be checked.
#[serde(default)]
pub is_tax_connector_enabled: bool,
/// Indicates if is_network_tokenization_enabled is enabled or not.
/// If set to `true` is_network_tokenization_enabled will be checked.
#[serde(default)]
pub is_network_tokenization_enabled: bool,
}
#[cfg(feature = "v1")]
@ -2138,6 +2148,11 @@ pub struct BusinessProfileResponse {
/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
pub is_tax_connector_enabled: bool,
/// Indicates if is_network_tokenization_enabled is enabled or not.
/// If set to `true` is_network_tokenization_enabled will be checked.
#[schema(default = false, example = false)]
pub is_network_tokenization_enabled: bool,
}
#[cfg(feature = "v2")]
@ -2246,6 +2261,11 @@ pub struct BusinessProfileResponse {
/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
pub is_tax_connector_enabled: bool,
/// Indicates if is_network_tokenization_enabled is enabled or not.
/// If set to `true` is_network_tokenization_enabled will be checked.
#[schema(default = false, example = false)]
pub is_network_tokenization_enabled: bool,
}
#[cfg(feature = "v1")]
@ -2359,6 +2379,9 @@ pub struct BusinessProfileUpdate {
/// Indicates if dynamic routing is enabled or not.
#[serde(default)]
pub dynamic_routing_algorithm: Option<serde_json::Value>,
/// Indicates if is_network_tokenization_enabled is enabled or not.
pub is_network_tokenization_enabled: Option<bool>,
}
#[cfg(feature = "v2")]
@ -2459,6 +2482,9 @@ pub struct BusinessProfileUpdate {
/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
pub is_tax_connector_enabled: Option<bool>,
/// Indicates if is_network_tokenization_enabled is enabled or not.
pub is_network_tokenization_enabled: Option<bool>,
}
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]

View File

@ -1026,7 +1026,15 @@ pub struct MandateIds {
#[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)]
pub enum MandateReferenceId {
ConnectorMandateId(ConnectorMandateReferenceId), // mandate_id send by connector
NetworkMandateId(String), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns
NetworkMandateId(String), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with card data
NetworkTokenWithNTI(NetworkTokenWithNTIRef), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with network token data
}
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq)]
pub struct NetworkTokenWithNTIRef {
pub network_transaction_id: String,
pub token_exp_month: Option<Secret<String>>,
pub token_exp_year: Option<Secret<String>>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq)]