feat(core): Add product authentication ids in business profile (#6811)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sahkal Poddar
2024-12-12 20:05:20 +05:30
committed by GitHub
parent e9a5615f2b
commit 1564ad72b8
11 changed files with 136 additions and 1 deletions

View File

@ -59,6 +59,7 @@ pub struct Profile {
pub is_auto_retries_enabled: bool,
pub max_auto_retries_enabled: Option<i16>,
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids: Option<serde_json::Value>,
}
#[cfg(feature = "v1")]
@ -100,6 +101,7 @@ pub struct ProfileSetter {
pub is_auto_retries_enabled: bool,
pub max_auto_retries_enabled: Option<i16>,
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids: Option<serde_json::Value>,
}
#[cfg(feature = "v1")]
@ -148,6 +150,7 @@ impl From<ProfileSetter> for Profile {
is_auto_retries_enabled: value.is_auto_retries_enabled,
max_auto_retries_enabled: value.max_auto_retries_enabled,
is_click_to_pay_enabled: value.is_click_to_pay_enabled,
authentication_product_ids: value.authentication_product_ids,
}
}
}
@ -198,6 +201,7 @@ pub struct ProfileGeneralUpdate {
pub is_auto_retries_enabled: Option<bool>,
pub max_auto_retries_enabled: Option<i16>,
pub is_click_to_pay_enabled: Option<bool>,
pub authentication_product_ids: Option<serde_json::Value>,
}
#[cfg(feature = "v1")]
@ -261,6 +265,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled,
max_auto_retries_enabled,
is_click_to_pay_enabled,
authentication_product_ids,
} = *update;
Self {
@ -299,6 +304,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled,
max_auto_retries_enabled,
is_click_to_pay_enabled,
authentication_product_ids,
}
}
ProfileUpdate::RoutingAlgorithmUpdate {
@ -339,6 +345,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
ProfileUpdate::DynamicRoutingAlgorithmUpdate {
dynamic_routing_algorithm,
@ -377,6 +384,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
ProfileUpdate::ExtendedCardInfoUpdate {
is_extended_card_info_enabled,
@ -415,6 +423,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
ProfileUpdate::ConnectorAgnosticMitUpdate {
is_connector_agnostic_mit_enabled,
@ -453,6 +462,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
ProfileUpdate::NetworkTokenizationUpdate {
is_network_tokenization_enabled,
@ -491,6 +501,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
}
}
@ -548,6 +559,7 @@ impl super::behaviour::Conversion for Profile {
is_auto_retries_enabled: Some(self.is_auto_retries_enabled),
max_auto_retries_enabled: self.max_auto_retries_enabled,
is_click_to_pay_enabled: self.is_click_to_pay_enabled,
authentication_product_ids: self.authentication_product_ids,
})
}
@ -617,6 +629,7 @@ impl super::behaviour::Conversion for Profile {
is_auto_retries_enabled: item.is_auto_retries_enabled.unwrap_or(false),
max_auto_retries_enabled: item.max_auto_retries_enabled,
is_click_to_pay_enabled: item.is_click_to_pay_enabled,
authentication_product_ids: item.authentication_product_ids,
})
}
.await
@ -670,6 +683,7 @@ impl super::behaviour::Conversion for Profile {
is_auto_retries_enabled: Some(self.is_auto_retries_enabled),
max_auto_retries_enabled: self.max_auto_retries_enabled,
is_click_to_pay_enabled: self.is_click_to_pay_enabled,
authentication_product_ids: self.authentication_product_ids,
})
}
}
@ -715,6 +729,7 @@ pub struct Profile {
pub version: common_enums::ApiVersion,
pub is_network_tokenization_enabled: bool,
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids: Option<serde_json::Value>,
}
#[cfg(feature = "v2")]
@ -756,6 +771,7 @@ pub struct ProfileSetter {
pub is_tax_connector_enabled: bool,
pub is_network_tokenization_enabled: bool,
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids: Option<serde_json::Value>,
}
#[cfg(feature = "v2")]
@ -804,6 +820,7 @@ impl From<ProfileSetter> for Profile {
version: consts::API_VERSION,
is_network_tokenization_enabled: value.is_network_tokenization_enabled,
is_click_to_pay_enabled: value.is_click_to_pay_enabled,
authentication_product_ids: value.authentication_product_ids,
}
}
}
@ -855,6 +872,7 @@ pub struct ProfileGeneralUpdate {
pub order_fulfillment_time_origin: Option<common_enums::OrderFulfillmentTimeOrigin>,
pub is_network_tokenization_enabled: Option<bool>,
pub is_click_to_pay_enabled: Option<bool>,
pub authentication_product_ids: Option<serde_json::Value>,
}
#[cfg(feature = "v2")]
@ -914,6 +932,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
order_fulfillment_time_origin,
is_network_tokenization_enabled,
is_click_to_pay_enabled,
authentication_product_ids,
} = *update;
Self {
profile_name,
@ -952,7 +971,8 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_network_tokenization_enabled,
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled,
is_click_to_pay_enabled: None,
authentication_product_ids,
}
}
ProfileUpdate::RoutingAlgorithmUpdate {
@ -995,6 +1015,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
ProfileUpdate::ExtendedCardInfoUpdate {
is_extended_card_info_enabled,
@ -1035,6 +1056,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
ProfileUpdate::ConnectorAgnosticMitUpdate {
is_connector_agnostic_mit_enabled,
@ -1075,6 +1097,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
ProfileUpdate::DefaultRoutingFallbackUpdate {
default_fallback_routing,
@ -1115,6 +1138,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
ProfileUpdate::NetworkTokenizationUpdate {
is_network_tokenization_enabled,
@ -1155,6 +1179,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
ProfileUpdate::CollectCvvDuringPaymentUpdate {
should_collect_cvv_during_payment,
@ -1195,6 +1220,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: None,
authentication_product_ids: None,
},
}
}
@ -1255,6 +1281,7 @@ impl super::behaviour::Conversion for Profile {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: self.is_click_to_pay_enabled,
authentication_product_ids: self.authentication_product_ids,
})
}
@ -1324,6 +1351,7 @@ impl super::behaviour::Conversion for Profile {
version: item.version,
is_network_tokenization_enabled: item.is_network_tokenization_enabled,
is_click_to_pay_enabled: item.is_click_to_pay_enabled,
authentication_product_ids: item.authentication_product_ids,
})
}
.await
@ -1380,6 +1408,7 @@ impl super::behaviour::Conversion for Profile {
is_auto_retries_enabled: None,
max_auto_retries_enabled: None,
is_click_to_pay_enabled: self.is_click_to_pay_enabled,
authentication_product_ids: self.authentication_product_ids,
})
}
}