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

feat(core): [Network Tokenization] pre network tokenization #6873

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
11 changes: 10 additions & 1 deletion api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -18120,6 +18120,10 @@
"type": "object",
"description": "Product authentication ids",
"nullable": true
},
"is_pre_network_tokenization_enabled": {
"type": "boolean",
"description": "Indicates if pre network tokenization is enabled or not"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -18153,7 +18157,8 @@
"is_tax_connector_enabled",
"is_network_tokenization_enabled",
"should_collect_cvv_during_payment",
"is_click_to_pay_enabled"
"is_click_to_pay_enabled",
"is_pre_network_tokenization_enabled"
],
"properties": {
"merchant_id": {
Expand Down Expand Up @@ -18344,6 +18349,10 @@
"type": "object",
"description": "Product authentication ids",
"nullable": true
},
"is_pre_network_tokenization_enabled": {
"type": "boolean",
"description": "Indicates if pre network tokenization is enabled or not"
}
}
},
Expand Down
11 changes: 10 additions & 1 deletion api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -22566,6 +22566,10 @@
"type": "object",
"description": "Product authentication ids",
"nullable": true
},
"is_pre_network_tokenization_enabled": {
"type": "boolean",
"description": "Indicates if pre network tokenization is enabled or not"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -22599,7 +22603,8 @@
"is_tax_connector_enabled",
"is_network_tokenization_enabled",
"is_auto_retries_enabled",
"is_click_to_pay_enabled"
"is_click_to_pay_enabled",
"is_pre_network_tokenization_enabled"
],
"properties": {
"merchant_id": {
Expand Down Expand Up @@ -22807,6 +22812,10 @@
"type": "object",
"description": "Product authentication ids",
"nullable": true
},
"is_pre_network_tokenization_enabled": {
"type": "boolean",
"description": "Indicates if pre network tokenization is enabled or not"
}
}
},
Expand Down
22 changes: 22 additions & 0 deletions crates/api_models/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,10 @@ pub struct ProfileCreate {
#[schema(value_type = Option<Object>, example = r#"{ "click_to_pay": "mca_ushduqwhdohwd", "netcetera": "mca_kwqhudqwd" }"#)]
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

/// Indicates if pre network tokenization is enabled or not
#[serde(default)]
pub is_pre_network_tokenization_enabled: bool,
}

#[nutype::nutype(
Expand Down Expand Up @@ -1985,6 +1989,10 @@ pub struct ProfileCreate {
#[schema(value_type = Option<Object>, example = r#"{ "click_to_pay": "mca_ushduqwhdohwd", "netcetera": "mca_kwqhudqwd" }"#)]
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

/// Indicates if pre network tokenization is enabled or not
#[serde(default)]
pub is_pre_network_tokenization_enabled: bool,
}

#[cfg(feature = "v1")]
Expand Down Expand Up @@ -2122,6 +2130,9 @@ pub struct ProfileResponse {
#[schema(value_type = Option<Object>, example = r#"{ "click_to_pay": "mca_ushduqwhdohwd", "netcetera": "mca_kwqhudqwd" }"#)]
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

/// Indicates if pre network tokenization is enabled or not
pub is_pre_network_tokenization_enabled: bool,
}

#[cfg(feature = "v2")]
Expand Down Expand Up @@ -2246,6 +2257,9 @@ pub struct ProfileResponse {
#[schema(value_type = Option<Object>, example = r#"{ "click_to_pay": "mca_ushduqwhdohwd", "netcetera": "mca_kwqhudqwd" }"#)]
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

/// Indicates if pre network tokenization is enabled or not
pub is_pre_network_tokenization_enabled: bool,
}

#[cfg(feature = "v1")]
Expand Down Expand Up @@ -2377,6 +2391,10 @@ pub struct ProfileUpdate {
#[schema(value_type = Option<Object>, example = r#"{ "click_to_pay": "mca_ushduqwhdohwd", "netcetera": "mca_kwqhudqwd" }"#)]
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

/// Indicates if pre network tokenization is enabled or not
#[schema(default = false, example = false)]
pub is_pre_network_tokenization_enabled: Option<bool>,
}

#[cfg(feature = "v2")]
Expand Down Expand Up @@ -2489,6 +2507,10 @@ pub struct ProfileUpdate {
#[schema(value_type = Option<Object>, example = r#"{ "click_to_pay": "mca_ushduqwhdohwd", "netcetera": "mca_kwqhudqwd" }"#)]
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

/// Indicates if pre network tokenization is enabled or not
#[schema(default = false, example = false)]
pub is_pre_network_tokenization_enabled: Option<bool>,
}

#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
Expand Down
12 changes: 12 additions & 0 deletions crates/diesel_models/src/business_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub struct Profile {
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub is_pre_network_tokenization_enabled: bool,
}

#[cfg(feature = "v1")]
Expand Down Expand Up @@ -106,6 +107,7 @@ pub struct ProfileNew {
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub is_pre_network_tokenization_enabled: Option<bool>,
}

#[cfg(feature = "v1")]
Expand Down Expand Up @@ -149,6 +151,7 @@ pub struct ProfileUpdateInternal {
pub is_click_to_pay_enabled: Option<bool>,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub is_pre_network_tokenization_enabled: Option<bool>,
}

#[cfg(feature = "v1")]
Expand Down Expand Up @@ -190,6 +193,7 @@ impl ProfileUpdateInternal {
max_auto_retries_enabled,
is_click_to_pay_enabled,
authentication_product_ids,
is_pre_network_tokenization_enabled,
} = self;
Profile {
profile_id: source.profile_id,
Expand Down Expand Up @@ -253,6 +257,8 @@ impl ProfileUpdateInternal {
.unwrap_or(source.is_click_to_pay_enabled),
authentication_product_ids: authentication_product_ids
.or(source.authentication_product_ids),
is_pre_network_tokenization_enabled: is_pre_network_tokenization_enabled
.unwrap_or(source.is_pre_network_tokenization_enabled),
}
}
}
Expand Down Expand Up @@ -310,6 +316,7 @@ pub struct Profile {
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub is_pre_network_tokenization_enabled: bool,
}

impl Profile {
Expand Down Expand Up @@ -371,6 +378,7 @@ pub struct ProfileNew {
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub is_pre_network_tokenization_enabled: Option<bool>,
}

#[cfg(feature = "v2")]
Expand Down Expand Up @@ -416,6 +424,7 @@ pub struct ProfileUpdateInternal {
pub is_click_to_pay_enabled: Option<bool>,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub is_pre_network_tokenization_enabled: Option<bool>,
}

#[cfg(feature = "v2")]
Expand Down Expand Up @@ -459,6 +468,7 @@ impl ProfileUpdateInternal {
max_auto_retries_enabled,
is_click_to_pay_enabled,
authentication_product_ids,
is_pre_network_tokenization_enabled,
} = self;
Profile {
id: source.id,
Expand Down Expand Up @@ -527,6 +537,8 @@ impl ProfileUpdateInternal {
.unwrap_or(source.is_click_to_pay_enabled),
authentication_product_ids: authentication_product_ids
.or(source.authentication_product_ids),
is_pre_network_tokenization_enabled: is_pre_network_tokenization_enabled
.unwrap_or(source.is_pre_network_tokenization_enabled),
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/diesel_models/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ diesel::table! {
max_auto_retries_enabled -> Nullable<Int2>,
is_click_to_pay_enabled -> Bool,
authentication_product_ids -> Nullable<Jsonb>,
is_pre_network_tokenization_enabled -> Bool,
}
}

Expand Down
1 change: 1 addition & 0 deletions crates/diesel_models/src/schema_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ diesel::table! {
max_auto_retries_enabled -> Nullable<Int2>,
is_click_to_pay_enabled -> Bool,
authentication_product_ids -> Nullable<Jsonb>,
is_pre_network_tokenization_enabled -> Bool,
}
}

Expand Down
Loading
Loading