Skip to content

Commit

Permalink
post payment processing
Browse files Browse the repository at this point in the history
  • Loading branch information
ImSagnik007 committed Jan 22, 2025
1 parent 96bf6c4 commit 17f5577
Show file tree
Hide file tree
Showing 14 changed files with 504 additions and 269 deletions.
24 changes: 12 additions & 12 deletions crates/api_models/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1868,9 +1868,9 @@ pub struct ProfileCreate {
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

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

#[nutype::nutype(
Expand Down Expand Up @@ -1990,9 +1990,9 @@ pub struct ProfileCreate {
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

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

#[cfg(feature = "v1")]
Expand Down Expand Up @@ -2131,8 +2131,8 @@ pub struct ProfileResponse {
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

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

#[cfg(feature = "v2")]
Expand Down Expand Up @@ -2258,8 +2258,8 @@ pub struct ProfileResponse {
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

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

#[cfg(feature = "v1")]
Expand Down Expand Up @@ -2392,9 +2392,9 @@ pub struct ProfileUpdate {
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

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

#[cfg(feature = "v2")]
Expand Down Expand Up @@ -2508,9 +2508,9 @@ pub struct ProfileUpdate {
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,

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

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

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

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

#[cfg(feature = "v1")]
Expand Down Expand Up @@ -193,7 +193,7 @@ impl ProfileUpdateInternal {
max_auto_retries_enabled,
is_click_to_pay_enabled,
authentication_product_ids,
is_tokenize_before_payment_enabled,
is_pre_network_tokenization_enabled,
} = self;
Profile {
profile_id: source.profile_id,
Expand Down Expand Up @@ -257,8 +257,8 @@ impl ProfileUpdateInternal {
.unwrap_or(source.is_click_to_pay_enabled),
authentication_product_ids: authentication_product_ids
.or(source.authentication_product_ids),
is_tokenize_before_payment_enabled: is_tokenize_before_payment_enabled
.unwrap_or(source.is_tokenize_before_payment_enabled),
is_pre_network_tokenization_enabled: is_pre_network_tokenization_enabled
.unwrap_or(source.is_pre_network_tokenization_enabled),
}
}
}
Expand Down Expand Up @@ -316,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 @@ -377,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 @@ -422,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 @@ -465,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 @@ -533,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
2 changes: 1 addition & 1 deletion crates/diesel_models/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ diesel::table! {
max_auto_retries_enabled -> Nullable<Int2>,
is_click_to_pay_enabled -> Bool,
authentication_product_ids -> Nullable<Jsonb>,
is_tokenize_before_payment_enabled -> Bool,
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

0 comments on commit 17f5577

Please sign in to comment.