mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
feat(router): profile specific fallback derivation while routing payments (#2806)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Aprabhat19 <amishaprabhat@gmail.com> Co-authored-by: Amisha Prabhat <55580080+Aprabhat19@users.noreply.github.com>
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
|
||||
use crate::routing::{
|
||||
LinkedRoutingConfigRetrieveResponse, MerchantRoutingAlgorithm, RoutingAlgorithmId,
|
||||
RoutingConfigRequest, RoutingDictionaryRecord, RoutingKind,
|
||||
LinkedRoutingConfigRetrieveResponse, MerchantRoutingAlgorithm, ProfileDefaultRoutingConfig,
|
||||
RoutingAlgorithmId, RoutingConfigRequest, RoutingDictionaryRecord, RoutingKind,
|
||||
RoutingPayloadWrapper,
|
||||
};
|
||||
#[cfg(feature = "business_profile_routing")]
|
||||
use crate::routing::{RoutingRetrieveLinkQuery, RoutingRetrieveQuery};
|
||||
@ -37,6 +38,17 @@ impl ApiEventMetric for LinkedRoutingConfigRetrieveResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl ApiEventMetric for RoutingPayloadWrapper {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Routing)
|
||||
}
|
||||
}
|
||||
impl ApiEventMetric for ProfileDefaultRoutingConfig {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Routing)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "business_profile_routing")]
|
||||
impl ApiEventMetric for RoutingRetrieveQuery {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
|
||||
@ -40,6 +40,12 @@ pub struct RoutingConfigRequest {
|
||||
pub profile_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub struct ProfileDefaultRoutingConfig {
|
||||
pub profile_id: String,
|
||||
pub connectors: Vec<RoutableConnectorChoice>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "business_profile_routing")]
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct RoutingRetrieveQuery {
|
||||
@ -389,6 +395,13 @@ pub enum RoutingAlgorithmKind {
|
||||
Advanced,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
|
||||
pub struct RoutingPayloadWrapper {
|
||||
pub updated_config: Vec<RoutableConnectorChoice>,
|
||||
pub profile_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(
|
||||
tag = "type",
|
||||
|
||||
Reference in New Issue
Block a user