From 78a7804b9c8b4db881b112fc72e31cfd3e97a82d Mon Sep 17 00:00:00 2001 From: Amisha Prabhat <55580080+Aprabhat19@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:13:38 +0530 Subject: [PATCH] refactor(routing): Remove backwards compatibility for the routing crate (#3015) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Shanks --- crates/api_models/Cargo.toml | 6 +- crates/api_models/src/events/routing.rs | 6 +- crates/api_models/src/routing.rs | 108 +-- crates/euclid/Cargo.toml | 1 - crates/euclid/src/frontend/ast.rs | 10 +- crates/euclid/src/frontend/dir.rs | 54 +- crates/euclid_wasm/Cargo.toml | 6 +- crates/euclid_wasm/src/lib.rs | 2 - crates/kgraph_utils/Cargo.toml | 2 +- crates/kgraph_utils/src/mca.rs | 6 +- crates/router/Cargo.toml | 8 +- .../stripe/payment_intents/types.rs | 4 - .../stripe/setup_intents/types.rs | 4 - crates/router/src/core/admin.rs | 4 - .../router/src/core/payment_methods/cards.rs | 28 +- .../router/src/core/payment_methods/utils.rs | 24 +- crates/router/src/core/payments.rs | 146 +-- crates/router/src/core/payments/helpers.rs | 2 +- crates/router/src/core/payments/routing.rs | 161 +--- .../src/core/payments/routing/transformers.rs | 4 - crates/router/src/core/payouts.rs | 6 - crates/router/src/core/payouts/helpers.rs | 28 +- crates/router/src/core/routing.rs | 864 +++++------------- crates/router/src/core/routing/helpers.rs | 22 +- .../router/src/core/routing/transformers.rs | 6 +- crates/router/src/db/merchant_account.rs | 6 - crates/router/src/routes/app.rs | 44 +- crates/router/src/routes/routing.rs | 254 ++--- crates/router/src/types/api/routing.rs | 10 +- crates/router/src/types/storage.rs | 5 +- .../Payments - Create/request.json | 4 - .../QuickStart/Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../QuickStart/Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Save card payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../QuickStart/Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../QuickStart/Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 10 +- .../Payments - Create/request.json | 6 +- .../QuickStart/Payments - Create/request.json | 10 +- .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Recurring Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Recurring Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Save card payments - Create/request.json | 12 +- .../Payments - Create/request.json | 4 - .../Save card payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Save card payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 12 +- .../QuickStart/Payments - Create/request.json | 4 - .../request.json | 4 - .../request.json | 4 - .../request.json | 4 - .../request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Recurring Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create Again/request.json | 4 - .../Payments - Create Yet Again/request.json | 4 - .../Payments/Payments - Create/request.json | 4 - .../Payments - Create-copy/request.json | 5 +- .../QuickStart/Payments - Create/request.json | 5 +- .../Refunds/Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../Payments - Create/request.json | 4 - .../QuickStart/Payments - Create/request.json | 4 - 122 files changed, 469 insertions(+), 1762 deletions(-) diff --git a/crates/api_models/Cargo.toml b/crates/api_models/Cargo.toml index 9df13c85a870..0595bdc3e75d 100644 --- a/crates/api_models/Cargo.toml +++ b/crates/api_models/Cargo.toml @@ -9,17 +9,13 @@ license.workspace = true [features] default = [] -business_profile_routing = [] -connector_choice_bcompat = [] errors = ["dep:actix-web", "dep:reqwest"] -backwards_compatibility = ["connector_choice_bcompat"] -connector_choice_mca_id = ["euclid/connector_choice_mca_id"] dummy_connector = ["euclid/dummy_connector", "common_enums/dummy_connector"] detailed_errors = [] payouts = [] frm = [] olap = [] -openapi = ["common_enums/openapi", "olap", "backwards_compatibility", "business_profile_routing", "connector_choice_mca_id", "recon", "dummy_connector", "olap"] +openapi = ["common_enums/openapi", "olap", "recon", "dummy_connector", "olap"] recon = [] v2 = [] diff --git a/crates/api_models/src/events/routing.rs b/crates/api_models/src/events/routing.rs index a09735bc5722..1f068678c598 100644 --- a/crates/api_models/src/events/routing.rs +++ b/crates/api_models/src/events/routing.rs @@ -3,10 +3,8 @@ use common_utils::events::{ApiEventMetric, ApiEventsType}; use crate::routing::{ LinkedRoutingConfigRetrieveResponse, MerchantRoutingAlgorithm, ProfileDefaultRoutingConfig, RoutingAlgorithmId, RoutingConfigRequest, RoutingDictionaryRecord, RoutingKind, - RoutingPayloadWrapper, + RoutingPayloadWrapper, RoutingRetrieveLinkQuery, RoutingRetrieveQuery, }; -#[cfg(feature = "business_profile_routing")] -use crate::routing::{RoutingRetrieveLinkQuery, RoutingRetrieveQuery}; impl ApiEventMetric for RoutingKind { fn get_api_event_type(&self) -> Option { @@ -49,7 +47,6 @@ impl ApiEventMetric for ProfileDefaultRoutingConfig { } } -#[cfg(feature = "business_profile_routing")] impl ApiEventMetric for RoutingRetrieveQuery { fn get_api_event_type(&self) -> Option { Some(ApiEventsType::Routing) @@ -62,7 +59,6 @@ impl ApiEventMetric for RoutingConfigRequest { } } -#[cfg(feature = "business_profile_routing")] impl ApiEventMetric for RoutingRetrieveLinkQuery { fn get_api_event_type(&self) -> Option { Some(ApiEventsType::Routing) diff --git a/crates/api_models/src/routing.rs b/crates/api_models/src/routing.rs index 66f3ff558ea4..4e62a5f67d29 100644 --- a/crates/api_models/src/routing.rs +++ b/crates/api_models/src/routing.rs @@ -45,7 +45,6 @@ pub struct ProfileDefaultRoutingConfig { pub connectors: Vec, } -#[cfg(feature = "business_profile_routing")] #[derive(Debug, serde::Deserialize, serde::Serialize)] pub struct RoutingRetrieveQuery { pub limit: Option, @@ -54,7 +53,6 @@ pub struct RoutingRetrieveQuery { pub profile_id: Option, } -#[cfg(feature = "business_profile_routing")] #[derive(Debug, serde::Deserialize, serde::Serialize)] pub struct RoutingRetrieveLinkQuery { pub profile_id: Option, @@ -77,7 +75,6 @@ pub enum LinkedRoutingConfigRetrieveResponse { /// Routing Algorithm specific to merchants pub struct MerchantRoutingAlgorithm { pub id: String, - #[cfg(feature = "business_profile_routing")] pub profile_id: String, pub name: String, pub description: String, @@ -129,27 +126,17 @@ impl EuclidAnalysable for ConnectorSelection { .into_iter() .map(|connector_choice| { let connector_name = connector_choice.connector.to_string(); - #[cfg(not(feature = "connector_choice_mca_id"))] - let sub_label = connector_choice.sub_label.clone(); - #[cfg(feature = "connector_choice_mca_id")] let mca_id = connector_choice.merchant_connector_id.clone(); ( euclid::frontend::dir::DirValue::Connector(Box::new(connector_choice.into())), std::collections::HashMap::from_iter([( "CONNECTOR_SELECTION".to_string(), - #[cfg(feature = "connector_choice_mca_id")] serde_json::json!({ "rule_name": rule_name, "connector_name": connector_name, "mca_id": mca_id, }), - #[cfg(not(feature = "connector_choice_mca_id"))] - serde_json ::json!({ - "rule_name": rule_name, - "connector_name": connector_name, - "sub_label": sub_label, - }), )]), ) }) @@ -163,143 +150,90 @@ pub struct ConnectorVolumeSplit { pub split: u8, } -#[cfg(feature = "connector_choice_bcompat")] +/// Routable Connector chosen for a payment +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)] +#[serde(from = "RoutableChoiceSerde", into = "RoutableChoiceSerde")] +pub struct RoutableConnectorChoice { + #[serde(skip)] + pub choice_kind: RoutableChoiceKind, + pub connector: RoutableConnectors, + pub merchant_connector_id: Option, +} + #[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)] pub enum RoutableChoiceKind { OnlyConnector, FullStruct, } -#[cfg(feature = "connector_choice_bcompat")] #[derive(Debug, serde::Deserialize, serde::Serialize)] #[serde(untagged)] pub enum RoutableChoiceSerde { OnlyConnector(Box), FullStruct { connector: RoutableConnectors, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id: Option, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: Option, }, } -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)] -#[cfg_attr( - feature = "connector_choice_bcompat", - serde(from = "RoutableChoiceSerde"), - serde(into = "RoutableChoiceSerde") -)] -#[cfg_attr(not(feature = "connector_choice_bcompat"), derive(PartialEq, Eq))] - -/// Routable Connector chosen for a payment -pub struct RoutableConnectorChoice { - #[cfg(feature = "connector_choice_bcompat")] - #[serde(skip)] - pub choice_kind: RoutableChoiceKind, - pub connector: RoutableConnectors, - #[cfg(feature = "connector_choice_mca_id")] - pub merchant_connector_id: Option, - #[cfg(not(feature = "connector_choice_mca_id"))] - pub sub_label: Option, -} - impl std::fmt::Display for RoutableConnectorChoice { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - #[cfg(feature = "connector_choice_mca_id")] let base = self.connector.to_string(); - #[cfg(not(feature = "connector_choice_mca_id"))] - let base = { - let mut sub_base = self.connector.to_string(); - if let Some(ref label) = self.sub_label { - sub_base.push('_'); - sub_base.push_str(label); - } - - sub_base - }; - write!(f, "{}", base) } } -#[cfg(feature = "connector_choice_bcompat")] -impl PartialEq for RoutableConnectorChoice { - fn eq(&self, other: &Self) -> bool { - #[cfg(not(feature = "connector_choice_mca_id"))] - { - self.connector.eq(&other.connector) && self.sub_label.eq(&other.sub_label) +impl From for ast::ConnectorChoice { + fn from(value: RoutableConnectorChoice) -> Self { + Self { + connector: value.connector, } + } +} - #[cfg(feature = "connector_choice_mca_id")] - { - self.connector.eq(&other.connector) - && self.merchant_connector_id.eq(&other.merchant_connector_id) - } +impl PartialEq for RoutableConnectorChoice { + fn eq(&self, other: &Self) -> bool { + self.connector.eq(&other.connector) + && self.merchant_connector_id.eq(&other.merchant_connector_id) } } -#[cfg(feature = "connector_choice_bcompat")] impl Eq for RoutableConnectorChoice {} -#[cfg(feature = "connector_choice_bcompat")] impl From for RoutableConnectorChoice { fn from(value: RoutableChoiceSerde) -> Self { match value { RoutableChoiceSerde::OnlyConnector(connector) => Self { choice_kind: RoutableChoiceKind::OnlyConnector, connector: *connector, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id: None, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: None, }, RoutableChoiceSerde::FullStruct { connector, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label, } => Self { choice_kind: RoutableChoiceKind::FullStruct, connector, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label, }, } } } -#[cfg(feature = "connector_choice_bcompat")] impl From for RoutableChoiceSerde { fn from(value: RoutableConnectorChoice) -> Self { match value.choice_kind { RoutableChoiceKind::OnlyConnector => Self::OnlyConnector(Box::new(value.connector)), RoutableChoiceKind::FullStruct => Self::FullStruct { connector: value.connector, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id: value.merchant_connector_id, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: value.sub_label, }, } } } -impl From for ast::ConnectorChoice { - fn from(value: RoutableConnectorChoice) -> Self { - Self { - connector: value.connector, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: value.sub_label, - } - } -} - #[derive(Debug, Copy, Clone, serde::Serialize, serde::Deserialize, strum::Display, ToSchema)] #[serde(rename_all = "snake_case")] #[strum(serialize_all = "snake_case")] @@ -499,7 +433,7 @@ impl RoutingAlgorithmRef { pub struct RoutingDictionaryRecord { pub id: String, - #[cfg(feature = "business_profile_routing")] + pub profile_id: String, pub name: String, pub kind: RoutingAlgorithmKind, diff --git a/crates/euclid/Cargo.toml b/crates/euclid/Cargo.toml index 295f0327788d..63c9c1508d93 100644 --- a/crates/euclid/Cargo.toml +++ b/crates/euclid/Cargo.toml @@ -29,7 +29,6 @@ common_utils = { version = "0.1.0", path = "../common_utils"} default = [] ast_parser = ["dep:nom"] valued_jit = [] -connector_choice_mca_id = [] dummy_connector = [] payouts = [] diff --git a/crates/euclid/src/frontend/ast.rs b/crates/euclid/src/frontend/ast.rs index ecb6aa87f27b..c77736effa9b 100644 --- a/crates/euclid/src/frontend/ast.rs +++ b/crates/euclid/src/frontend/ast.rs @@ -12,8 +12,6 @@ use crate::types::{DataType, Metadata}; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] pub struct ConnectorChoice { pub connector: RoutableConnectors, - #[cfg(not(feature = "connector_choice_mca_id"))] - pub sub_label: Option, } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)] @@ -163,18 +161,16 @@ pub struct Program { #[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] pub struct RoutableConnectorChoice { - #[cfg(feature = "connector_choice_bcompat")] #[serde(skip)] pub choice_kind: RoutableChoiceKind, - #[cfg(feature = "connector_choice_mca_id")] + pub connector: RoutableConnectors, pub merchant_connector_id: Option, - #[cfg(not(feature = "connector_choice_mca_id"))] - pub sub_label: Option, } -#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[derive(Debug, Default, Clone, Deserialize, Serialize, ToSchema)] pub enum RoutableChoiceKind { OnlyConnector, + #[default] FullStruct, } diff --git a/crates/euclid/src/frontend/dir.rs b/crates/euclid/src/frontend/dir.rs index 8cfdf6567166..9a7134e708a7 100644 --- a/crates/euclid/src/frontend/dir.rs +++ b/crates/euclid/src/frontend/dir.rs @@ -9,7 +9,6 @@ use strum::IntoEnumIterator; use crate::{enums as euclid_enums, frontend::ast, types}; #[macro_export] -#[cfg(feature = "connector_choice_mca_id")] macro_rules! dirval { (Connector = $name:ident) => { $crate::frontend::dir::DirValue::Connector(Box::new( @@ -46,53 +45,6 @@ macro_rules! dirval { }}; } -#[macro_export] -#[cfg(not(feature = "connector_choice_mca_id"))] -macro_rules! dirval { - (Connector = $name:ident) => { - $crate::frontend::dir::DirValue::Connector(Box::new( - $crate::frontend::ast::ConnectorChoice { - connector: $crate::enums::RoutableConnectors::$name, - sub_label: None, - }, - )) - }; - - (Connector = ($name:ident, $sub_label:literal)) => { - $crate::frontend::dir::DirValue::Connector(Box::new( - $crate::frontend::ast::ConnectorChoice { - connector: $crate::enums::RoutableConnectors::$name, - sub_label: Some($sub_label.to_string()), - }, - )) - }; - - ($key:ident = $val:ident) => {{ - pub use $crate::frontend::dir::enums::*; - - $crate::frontend::dir::DirValue::$key($key::$val) - }}; - - ($key:ident = $num:literal) => {{ - $crate::frontend::dir::DirValue::$key($crate::types::NumValue { - number: common_utils::types::MinorUnit::new($num), - refinement: None, - }) - }}; - - ($key:ident s= $str:literal) => {{ - $crate::frontend::dir::DirValue::$key($crate::types::StrValue { - value: $str.to_string(), - }) - }}; - ($key:literal = $str:literal) => {{ - $crate::frontend::dir::DirValue::MetaData($crate::types::MetadataValue { - key: $key.to_string(), - value: $str.to_string(), - }) - }}; -} - #[derive(Debug, Clone, Hash, PartialEq, Eq, serde::Serialize)] pub struct DirKey { pub kind: DirKeyKind, @@ -482,11 +434,7 @@ impl DirKeyKind { Self::Connector => Some( common_enums::RoutableConnectors::iter() .map(|connector| { - DirValue::Connector(Box::new(ast::ConnectorChoice { - connector, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: None, - })) + DirValue::Connector(Box::new(ast::ConnectorChoice { connector })) }) .collect(), ), diff --git a/crates/euclid_wasm/Cargo.toml b/crates/euclid_wasm/Cargo.toml index 293940f27c4a..be8f61240d66 100644 --- a/crates/euclid_wasm/Cargo.toml +++ b/crates/euclid_wasm/Cargo.toml @@ -11,10 +11,8 @@ license.workspace = true crate-type = ["cdylib"] [features] -default = ["connector_choice_bcompat", "payouts", "connector_choice_mca_id"] -release = ["connector_choice_bcompat", "connector_choice_mca_id", "payouts"] -connector_choice_bcompat = ["api_models/connector_choice_bcompat"] -connector_choice_mca_id = ["api_models/connector_choice_mca_id", "euclid/connector_choice_mca_id", "kgraph_utils/connector_choice_mca_id"] +default = ["payouts"] +release = ["payouts"] dummy_connector = ["kgraph_utils/dummy_connector", "connector_configs/dummy_connector"] production = ["connector_configs/production"] development = ["connector_configs/development"] diff --git a/crates/euclid_wasm/src/lib.rs b/crates/euclid_wasm/src/lib.rs index 031440ae5412..eed5c38af9d4 100644 --- a/crates/euclid_wasm/src/lib.rs +++ b/crates/euclid_wasm/src/lib.rs @@ -84,8 +84,6 @@ pub fn seed_knowledge_graph(mcas: JsValue) -> JsResult { .map(|mca| { Ok::<_, strum::ParseError>(ast::ConnectorChoice { connector: RoutableConnectors::from_str(&mca.connector_name)?, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: mca.business_sub_label.clone(), }) }) .collect::>() diff --git a/crates/kgraph_utils/Cargo.toml b/crates/kgraph_utils/Cargo.toml index 7528461dbc52..6172e75629f6 100644 --- a/crates/kgraph_utils/Cargo.toml +++ b/crates/kgraph_utils/Cargo.toml @@ -8,7 +8,7 @@ license.workspace = true [features] dummy_connector = ["api_models/dummy_connector", "euclid/dummy_connector"] -connector_choice_mca_id = ["api_models/connector_choice_mca_id", "euclid/connector_choice_mca_id"] + [dependencies] api_models = { version = "0.1.0", path = "../api_models", package = "api_models" } diff --git a/crates/kgraph_utils/src/mca.rs b/crates/kgraph_utils/src/mca.rs index 5b31a6be648e..a636c4b3a2a7 100644 --- a/crates/kgraph_utils/src/mca.rs +++ b/crates/kgraph_utils/src/mca.rs @@ -651,11 +651,7 @@ fn compile_merchant_connector_graph( None, ) .map_err(KgraphError::GraphConstructionError)?; - let connector_dir_val = dir::DirValue::Connector(Box::new(ast::ConnectorChoice { - connector, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: mca.business_sub_label.clone(), - })); + let connector_dir_val = dir::DirValue::Connector(Box::new(ast::ConnectorChoice { connector })); let connector_info = "Connector"; let connector_node_id = diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml index 1212869600bf..438e0dc323d9 100644 --- a/crates/router/Cargo.toml +++ b/crates/router/Cargo.toml @@ -9,24 +9,20 @@ readme = "README.md" license.workspace = true [features] -default = ["kv_store", "stripe", "oltp", "olap", "backwards_compatibility", "accounts_cache", "dummy_connector", "payouts", "payout_retry", "business_profile_routing", "connector_choice_mca_id", "profile_specific_fallback_routing", "retry", "frm", "tls"] +default = ["kv_store", "stripe", "oltp", "olap", "accounts_cache", "dummy_connector", "payouts", "payout_retry", "retry", "frm", "tls"] tls = ["actix-web/rustls-0_22"] keymanager_mtls = ["reqwest/rustls-tls","common_utils/keymanager_mtls"] email = ["external_services/email", "scheduler/email", "olap"] keymanager_create = [] frm = ["api_models/frm", "hyperswitch_domain_models/frm"] stripe = ["dep:serde_qs"] -release = ["stripe", "email", "backwards_compatibility", "business_profile_routing", "accounts_cache", "kv_store", "connector_choice_mca_id", "profile_specific_fallback_routing", "vergen", "recon", "external_services/aws_kms", "external_services/aws_s3","keymanager_mtls","keymanager_create"] +release = ["stripe", "email", "accounts_cache", "kv_store", "vergen", "recon", "external_services/aws_kms", "external_services/aws_s3","keymanager_mtls","keymanager_create"] olap = ["hyperswitch_domain_models/olap", "storage_impl/olap", "scheduler/olap", "api_models/olap", "dep:analytics"] oltp = ["storage_impl/oltp"] kv_store = ["scheduler/kv_store"] accounts_cache = [] vergen = ["router_env/vergen"] -backwards_compatibility = ["api_models/backwards_compatibility"] -business_profile_routing = ["api_models/business_profile_routing"] -profile_specific_fallback_routing = [] dummy_connector = ["api_models/dummy_connector", "euclid/dummy_connector", "kgraph_utils/dummy_connector"] -connector_choice_mca_id = ["api_models/connector_choice_mca_id", "euclid/connector_choice_mca_id", "kgraph_utils/connector_choice_mca_id"] external_access_dc = ["dummy_connector"] detailed_errors = ["api_models/detailed_errors", "error-stack/serde"] payouts = ["api_models/payouts", "common_enums/payouts", "hyperswitch_domain_models/payouts", "storage_impl/payouts"] diff --git a/crates/router/src/compatibility/stripe/payment_intents/types.rs b/crates/router/src/compatibility/stripe/payment_intents/types.rs index 62cf9416b24b..c06193125606 100644 --- a/crates/router/src/compatibility/stripe/payment_intents/types.rs +++ b/crates/router/src/compatibility/stripe/payment_intents/types.rs @@ -293,13 +293,9 @@ impl TryFrom for payments::PaymentsRequest { .map(|connector| { api_models::routing::RoutingAlgorithm::Single(Box::new( api_models::routing::RoutableConnectorChoice { - #[cfg(feature = "backwards_compatibility")] choice_kind: api_models::routing::RoutableChoiceKind::FullStruct, connector, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id: None, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: None, }, )) }) diff --git a/crates/router/src/compatibility/stripe/setup_intents/types.rs b/crates/router/src/compatibility/stripe/setup_intents/types.rs index b5408f600b47..66c35637de71 100644 --- a/crates/router/src/compatibility/stripe/setup_intents/types.rs +++ b/crates/router/src/compatibility/stripe/setup_intents/types.rs @@ -189,13 +189,9 @@ impl TryFrom for payments::PaymentsRequest { .map(|connector| { api_models::routing::RoutingAlgorithm::Single(Box::new( api_models::routing::RoutableConnectorChoice { - #[cfg(feature = "backwards_compatibility")] choice_kind: api_models::routing::RoutableChoiceKind::FullStruct, connector, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id: None, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: None, }, )) }) diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index af6d469fd3af..8a7854d658bf 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -1340,13 +1340,9 @@ pub async fn create_payment_connector( if let Some(routable_connector_val) = routable_connector { let choice = routing_types::RoutableConnectorChoice { - #[cfg(feature = "backwards_compatibility")] choice_kind: routing_types::RoutableChoiceKind::FullStruct, connector: routable_connector_val, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id: Some(mca.merchant_connector_id.clone()), - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: req.business_sub_label.clone(), }; if !default_routing_config.contains(&choice) { diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs index 24cc9583d907..5a4d40ef85ee 100644 --- a/crates/router/src/core/payment_methods/cards.rs +++ b/crates/router/src/core/payment_methods/cards.rs @@ -44,8 +44,6 @@ use super::surcharge_decision_configs::{ perform_surcharge_decision_management_for_payment_method_list, perform_surcharge_decision_management_for_saved_cards, }; -#[cfg(not(feature = "connector_choice_mca_id"))] -use crate::core::utils::get_connector_label; #[cfg(feature = "payouts")] use crate::types::domain::types::AsyncLift; use crate::{ @@ -2577,7 +2575,6 @@ pub async fn list_payment_methods( let mut routable_choice_list = vec![]; for choice in routing_choice { let routable_choice = routing_types::RoutableConnectorChoice { - #[cfg(feature = "backwards_compatibility")] choice_kind: routing_types::RoutableChoiceKind::FullStruct, connector: choice .connector @@ -2585,10 +2582,7 @@ pub async fn list_payment_methods( .to_string() .parse::() .change_context(errors::ApiErrorResponse::InternalServerError)?, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id: choice.connector.merchant_connector_id.clone(), - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: choice.sub_label, }; routable_choice_list.push(routable_choice); } @@ -2619,22 +2613,6 @@ pub async fn list_payment_methods( .first() .ok_or(errors::ApiErrorResponse::IncorrectPaymentMethodConfiguration)?; - #[cfg(not(feature = "connector_choice_mca_id"))] - let connector_label = get_connector_label( - payment_intent.business_country, - payment_intent.business_label.as_ref(), - #[cfg(not(feature = "connector_choice_mca_id"))] - first_routable_connector.sub_label.as_ref(), - #[cfg(feature = "connector_choice_mca_id")] - None, - first_routable_connector.connector.to_string().as_str(), - ); - #[cfg(not(feature = "connector_choice_mca_id"))] - let matched_mca = filtered_mcas - .iter() - .find(|m| connector_label == m.connector_label); - - #[cfg(feature = "connector_choice_mca_id")] let matched_mca = filtered_mcas.iter().find(|m| { first_routable_connector.merchant_connector_id.as_ref() == Some(&m.merchant_connector_id) @@ -3437,11 +3415,7 @@ pub async fn filter_payment_methods( connector_variant.to_string().as_str(), ) { context_values.push(dir::DirValue::Connector(Box::new( - api_models::routing::ast::ConnectorChoice { - connector, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: None, - }, + api_models::routing::ast::ConnectorChoice { connector }, ))); }; diff --git a/crates/router/src/core/payment_methods/utils.rs b/crates/router/src/core/payment_methods/utils.rs index 96ed882f248a..7d90a5cb6bc0 100644 --- a/crates/router/src/core/payment_methods/utils.rs +++ b/crates/router/src/core/payment_methods/utils.rs @@ -311,11 +311,7 @@ fn construct_supported_connectors_for_update_mandate_node( .ok() .map(|connector| { dir::DirValue::Connector(Box::new( - api_models::routing::ast::ConnectorChoice { - connector, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: None, - }, + api_models::routing::ast::ConnectorChoice { connector }, )) }) }), @@ -336,11 +332,7 @@ fn construct_supported_connectors_for_update_mandate_node( .ok() .map(|connector| { dir::DirValue::Connector(Box::new( - api_models::routing::ast::ConnectorChoice { - connector, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: None, - }, + api_models::routing::ast::ConnectorChoice { connector }, )) }) }), @@ -393,11 +385,7 @@ fn construct_supported_connectors_for_update_mandate_node( .ok() .map(|connector| { dir::DirValue::Connector(Box::new( - api_models::routing::ast::ConnectorChoice { - connector, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: None, - }, + api_models::routing::ast::ConnectorChoice { connector }, )) }) }), @@ -468,11 +456,7 @@ fn construct_supported_connectors_for_mandate_node( .filter_map(|connector| { match api_enums::RoutableConnectors::from_str(connector.to_string().as_str()) { Ok(connector) => Some(dir::DirValue::Connector(Box::new( - api_models::routing::ast::ConnectorChoice { - connector, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: None, - }, + api_models::routing::ast::ConnectorChoice { connector }, ))), Err(_) => None, } diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index c6a836f9c47e..5cad096bd395 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -3298,10 +3298,9 @@ where let mut routing_data = storage::RoutingData { routed_through: payment_data.payment_attempt.connector.clone(), - #[cfg(feature = "connector_choice_mca_id")] + merchant_connector_id: payment_data.payment_attempt.merchant_connector_id.clone(), - #[cfg(not(feature = "connector_choice_mca_id"))] - business_sub_label: payment_data.payment_attempt.business_sub_label.clone(), + algorithm: request_straight_through.clone(), routing_info: payment_data .payment_attempt @@ -3337,14 +3336,8 @@ where .attach_printable("error serializing payment routing info to serde value")?; payment_data.payment_attempt.connector = routing_data.routed_through; - #[cfg(feature = "connector_choice_mca_id")] - { - payment_data.payment_attempt.merchant_connector_id = routing_data.merchant_connector_id; - } - #[cfg(not(feature = "connector_choice_mca_id"))] - { - payment_data.payment_attempt.business_sub_label = routing_data.business_sub_label; - } + + payment_data.payment_attempt.merchant_connector_id = routing_data.merchant_connector_id; payment_data.payment_attempt.straight_through_algorithm = Some(encoded_info); Ok(decided_connector) @@ -3388,21 +3381,17 @@ where &state.conf.connectors, &mandate_connector_details.connector, api::GetToken::Connector, - #[cfg(feature = "connector_choice_mca_id")] mandate_connector_details.merchant_connector_id.clone(), - #[cfg(not(feature = "connector_choice_mca_id"))] - None, ) .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Invalid connector name received in 'routed_through'")?; routing_data.routed_through = Some(mandate_connector_details.connector.clone()); - #[cfg(feature = "connector_choice_mca_id")] - { - routing_data - .merchant_connector_id - .clone_from(&mandate_connector_details.merchant_connector_id); - } + + routing_data + .merchant_connector_id + .clone_from(&mandate_connector_details.merchant_connector_id); + return Ok(ConnectorCallType::PreDetermined(connector_data)); } @@ -3432,26 +3421,17 @@ where .ok_or(errors::ApiErrorResponse::IncorrectPaymentMethodConfiguration)?; routing_data.routed_through = Some(first_routable_connector.connector.to_string()); - #[cfg(feature = "connector_choice_mca_id")] - { - routing_data - .merchant_connector_id - .clone_from(&first_routable_connector.merchant_connector_id); - } - #[cfg(not(feature = "connector_choice_mca_id"))] - { - routing_data.business_sub_label = first_routable_connector.sub_label.clone(); - } + + routing_data + .merchant_connector_id + .clone_from(&first_routable_connector.merchant_connector_id); for connector_choice in routable_connector_list.clone() { let connector_data = api::ConnectorData::get_connector_by_name( &state.conf.connectors, &connector_choice.connector.to_string(), api::GetToken::Connector, - #[cfg(feature = "connector_choice_mca_id")] connector_choice.merchant_connector_id.clone(), - #[cfg(not(feature = "connector_choice_mca_id"))] - None, ) .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Invalid connector name received")?; @@ -3459,11 +3439,11 @@ where pre_routing_connector_data_list.push(connector_data); } - #[cfg(all(feature = "retry", feature = "connector_choice_mca_id"))] + #[cfg(feature = "retry")] let should_do_retry = retry::config_should_call_gsm(&*state.store, &merchant_account.merchant_id).await; - #[cfg(all(feature = "retry", feature = "connector_choice_mca_id"))] + #[cfg(feature = "retry")] if payment_data.payment_attempt.payment_method_type == Some(storage_enums::PaymentMethodType::ApplePay) && should_do_retry @@ -3510,19 +3490,14 @@ where .attach_printable("Failed execution of straight through routing")?; if check_eligibility { - #[cfg(feature = "business_profile_routing")] let profile_id = payment_data.payment_intent.profile_id.clone(); - #[cfg(not(feature = "business_profile_routing"))] - let _profile_id: Option = None; - connectors = routing::perform_eligibility_analysis_with_fallback( &state.clone(), key_store, connectors, &TransactionData::Payment(payment_data), eligible_connectors, - #[cfg(feature = "business_profile_routing")] profile_id, ) .await @@ -3537,10 +3512,7 @@ where &state.conf.connectors, &conn.connector.to_string(), api::GetToken::Connector, - #[cfg(feature = "connector_choice_mca_id")] conn.merchant_connector_id.clone(), - #[cfg(not(feature = "connector_choice_mca_id"))] - None, ) }) .collect::, _>>() @@ -3567,19 +3539,14 @@ where .attach_printable("Failed execution of straight through routing")?; if check_eligibility { - #[cfg(feature = "business_profile_routing")] let profile_id = payment_data.payment_intent.profile_id.clone(); - #[cfg(not(feature = "business_profile_routing"))] - let _profile_id: Option = None; - connectors = routing::perform_eligibility_analysis_with_fallback( &state, key_store, connectors, &TransactionData::Payment(payment_data), eligible_connectors, - #[cfg(feature = "business_profile_routing")] profile_id, ) .await @@ -3594,10 +3561,7 @@ where &state.conf.connectors, &conn.connector.to_string(), api::GetToken::Connector, - #[cfg(feature = "connector_choice_mca_id")] conn.merchant_connector_id, - #[cfg(not(feature = "connector_choice_mca_id"))] - None, ) }) .collect::, _>>() @@ -3769,19 +3733,10 @@ pub async fn decide_multiplex_connector_for_normal_or_recurring_payment = Vec::new(); - #[cfg(not(feature = "connector_choice_mca_id"))] - for mut connector_data in connectors { - if !routing_enabled_pms.contains(&connector_data.payment_method_type) { - final_list.push(connector_data); - } else if let Some(choice) = result.get(&connector_data.payment_method_type) { - let routing_choice = choice - .first() - .ok_or(errors::ApiErrorResponse::InternalServerError)?; - if connector_data.connector.connector_name == routing_choice.connector.connector_name { - connector_data.business_sub_label = routing_choice.sub_label.clone(); - final_list.push(connector_data); - } - } - } - - #[cfg(feature = "connector_choice_mca_id")] for connector_data in connectors { if !routing_enabled_pms.contains(&connector_data.payment_method_type) { final_list.push(connector_data); @@ -3987,27 +3924,15 @@ where { #[allow(unused_variables)] let (profile_id, routing_algorithm) = match &transaction_data { - TransactionData::Payment(payment_data) => { - if cfg!(feature = "business_profile_routing") { - ( - payment_data.payment_intent.profile_id.clone(), - business_profile.routing_algorithm.clone(), - ) - } else { - (None, merchant_account.routing_algorithm.clone()) - } - } + TransactionData::Payment(payment_data) => ( + payment_data.payment_intent.profile_id.clone(), + business_profile.routing_algorithm.clone(), + ), #[cfg(feature = "payouts")] - TransactionData::Payout(payout_data) => { - if cfg!(feature = "business_profile_routing") { - ( - Some(payout_data.payout_attempt.profile_id.clone()), - business_profile.payout_routing_algorithm.clone(), - ) - } else { - (None, merchant_account.payout_routing_algorithm.clone()) - } - } + TransactionData::Payout(payout_data) => ( + Some(payout_data.payout_attempt.profile_id.clone()), + business_profile.payout_routing_algorithm.clone(), + ), }; let algorithm_ref = routing_algorithm @@ -4032,7 +3957,6 @@ where connectors, &transaction_data, eligible_connectors, - #[cfg(feature = "business_profile_routing")] profile_id, ) .await @@ -4053,10 +3977,7 @@ where &state.conf.connectors, &conn.connector.to_string(), api::GetToken::Connector, - #[cfg(feature = "connector_choice_mca_id")] conn.merchant_connector_id, - #[cfg(not(feature = "connector_choice_mca_id"))] - None, ) }) .collect::, _>>() @@ -4080,14 +4001,7 @@ where TransactionData::Payout(_) => { routing_data.routed_through = Some(first_connector_choice.connector.to_string()); - #[cfg(feature = "connector_choice_mca_id")] - { - routing_data.merchant_connector_id = first_connector_choice.merchant_connector_id; - } - #[cfg(not(feature = "connector_choice_mca_id"))] - { - routing_data.business_sub_label = first_connector_choice.sub_label; - } + routing_data.merchant_connector_id = first_connector_choice.merchant_connector_id; Ok(ConnectorCallType::Retryable(connector_data)) } diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index 1579322995b5..3629457d5ab6 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -4220,7 +4220,7 @@ pub fn get_applepay_metadata( }) } -#[cfg(all(feature = "retry", feature = "connector_choice_mca_id"))] +#[cfg(feature = "retry")] pub async fn get_apple_pay_retryable_connectors( state: &SessionState, merchant_account: &domain::MerchantAccount, diff --git a/crates/router/src/core/payments/routing.rs b/crates/router/src/core/payments/routing.rs index d6904e09a3d5..0ff53c63b484 100644 --- a/crates/router/src/core/payments/routing.rs +++ b/crates/router/src/core/payments/routing.rs @@ -36,8 +36,6 @@ use storage_impl::redis::cache::{CacheKey, CGRAPH_CACHE, ROUTING_CACHE}; #[cfg(feature = "payouts")] use crate::core::payouts; -#[cfg(not(feature = "business_profile_routing"))] -use crate::utils::StringExt; use crate::{ core::{ errors, errors as oss_errors, payments as payments_oss, @@ -77,10 +75,6 @@ pub struct SessionRoutingPmTypeInput<'a> { routing_algorithm: &'a MerchantAccountRoutingAlgorithm, backend_input: dsl_inputs::BackendInput, allowed_connectors: FxHashMap, - #[cfg(any( - feature = "business_profile_routing", - feature = "profile_specific_fallback_routing" - ))] profile_id: Option, } @@ -262,10 +256,6 @@ pub async fn perform_static_routing_v1( algorithm_ref: routing_types::RoutingAlgorithmRef, transaction_data: &routing::TransactionData<'_, F>, ) -> RoutingResult> { - #[cfg(any( - feature = "profile_specific_fallback_routing", - feature = "business_profile_routing" - ))] let profile_id = match transaction_data { routing::TransactionData::Payment(payment_data) => payment_data .payment_intent @@ -281,9 +271,6 @@ pub async fn perform_static_routing_v1( } else { let fallback_config = routing_helpers::get_merchant_default_config( &*state.clone().store, - #[cfg(not(feature = "profile_specific_fallback_routing"))] - merchant_id, - #[cfg(feature = "profile_specific_fallback_routing")] profile_id, &api_enums::TransactionType::from(transaction_data), ) @@ -296,7 +283,6 @@ pub async fn perform_static_routing_v1( state, merchant_id, &algorithm_id, - #[cfg(feature = "business_profile_routing")] Some(profile_id).cloned(), &api_enums::TransactionType::from(transaction_data), ) @@ -328,10 +314,9 @@ async fn ensure_algorithm_cached_v1( state: &SessionState, merchant_id: &str, algorithm_id: &str, - #[cfg(feature = "business_profile_routing")] profile_id: Option, + profile_id: Option, transaction_type: &api_enums::TransactionType, ) -> RoutingResult> { - #[cfg(feature = "business_profile_routing")] let key = { let profile_id = profile_id .clone() @@ -349,17 +334,6 @@ async fn ensure_algorithm_cached_v1( } }; - #[cfg(not(feature = "business_profile_routing"))] - let key = match transaction_type { - api_enums::TransactionType::Payment => { - format!("dsl_{merchant_id}") - } - #[cfg(feature = "payouts")] - api_enums::TransactionType::Payout => { - format!("dsl_po_{merchant_id}") - } - }; - let cached_algorithm = ROUTING_CACHE .get_val::>(CacheKey { key: key.clone(), @@ -370,14 +344,7 @@ async fn ensure_algorithm_cached_v1( let algorithm = if let Some(algo) = cached_algorithm { algo } else { - refresh_routing_cache_v1( - state, - key.clone(), - algorithm_id, - #[cfg(feature = "business_profile_routing")] - profile_id, - ) - .await? + refresh_routing_cache_v1(state, key.clone(), algorithm_id, profile_id).await? }; Ok(algorithm) @@ -429,9 +396,8 @@ pub async fn refresh_routing_cache_v1( state: &SessionState, key: String, algorithm_id: &str, - #[cfg(feature = "business_profile_routing")] profile_id: Option, + profile_id: Option, ) -> RoutingResult> { - #[cfg(feature = "business_profile_routing")] let algorithm = { let algorithm = state .store @@ -448,22 +414,6 @@ pub async fn refresh_routing_cache_v1( algorithm }; - #[cfg(not(feature = "business_profile_routing"))] - let algorithm = { - let config = state - .store - .find_config_by_key(algorithm_id) - .await - .change_context(errors::RoutingError::DslMissingInDb) - .attach_printable("DSL not found in DB")?; - - let algorithm: routing_types::RoutingAlgorithm = config - .config - .parse_struct("Program") - .change_context(errors::RoutingError::DslParsingError) - .attach_printable("Error parsing routing algorithm from configs")?; - algorithm - }; let cached_algorithm = match algorithm { routing_types::RoutingAlgorithm::Single(conn) => CachedAlgorithm::Single(conn), routing_types::RoutingAlgorithm::Priority(plist) => CachedAlgorithm::Priority(plist), @@ -531,12 +481,11 @@ pub fn perform_volume_split( pub async fn get_merchant_cgraph<'a>( state: &SessionState, key_store: &domain::MerchantKeyStore, - #[cfg(feature = "business_profile_routing")] profile_id: Option, + profile_id: Option, transaction_type: &api_enums::TransactionType, ) -> RoutingResult>> { let merchant_id = &key_store.merchant_id; - #[cfg(feature = "business_profile_routing")] let key = { let profile_id = profile_id .clone() @@ -551,13 +500,6 @@ pub async fn get_merchant_cgraph<'a>( } }; - #[cfg(not(feature = "business_profile_routing"))] - let key = match transaction_type { - api_enums::TransactionType::Payment => format!("cgraph_{}", merchant_id), - #[cfg(feature = "payouts")] - api_enums::TransactionType::Payout => format!("cgraph_po_{}", merchant_id), - }; - let cached_cgraph = CGRAPH_CACHE .get_val::>>( CacheKey { @@ -570,15 +512,7 @@ pub async fn get_merchant_cgraph<'a>( let cgraph = if let Some(graph) = cached_cgraph { graph } else { - refresh_cgraph_cache( - state, - key_store, - key.clone(), - #[cfg(feature = "business_profile_routing")] - profile_id, - transaction_type, - ) - .await? + refresh_cgraph_cache(state, key_store, key.clone(), profile_id, transaction_type).await? }; Ok(cgraph) @@ -588,7 +522,7 @@ pub async fn refresh_cgraph_cache<'a>( state: &SessionState, key_store: &domain::MerchantKeyStore, key: String, - #[cfg(feature = "business_profile_routing")] profile_id: Option, + profile_id: Option, transaction_type: &api_enums::TransactionType, ) -> RoutingResult>> { let mut merchant_connector_accounts = state @@ -617,7 +551,6 @@ pub async fn refresh_cgraph_cache<'a>( } }; - #[cfg(feature = "business_profile_routing")] let merchant_connector_accounts = payments_oss::helpers::filter_mca_based_on_business_profile( merchant_connector_accounts, profile_id, @@ -679,7 +612,7 @@ async fn perform_cgraph_filtering( chosen: Vec, backend_input: dsl_inputs::BackendInput, eligible_connectors: Option<&Vec>, - #[cfg(feature = "business_profile_routing")] profile_id: Option, + profile_id: Option, transaction_type: &api_enums::TransactionType, ) -> RoutingResult> { let context = euclid_graph::AnalysisContext::from_dir_values( @@ -687,14 +620,7 @@ async fn perform_cgraph_filtering( .into_context() .change_context(errors::RoutingError::KgraphAnalysisError)?, ); - let cached_cgraph = get_merchant_cgraph( - state, - key_store, - #[cfg(feature = "business_profile_routing")] - profile_id, - transaction_type, - ) - .await?; + let cached_cgraph = get_merchant_cgraph(state, key_store, profile_id, transaction_type).await?; let mut final_selection = Vec::::new(); for choice in chosen { @@ -730,7 +656,7 @@ pub async fn perform_eligibility_analysis( chosen: Vec, transaction_data: &routing::TransactionData<'_, F>, eligible_connectors: Option<&Vec>, - #[cfg(feature = "business_profile_routing")] profile_id: Option, + profile_id: Option, ) -> RoutingResult> { let backend_input = match transaction_data { routing::TransactionData::Payment(payment_data) => make_dsl_input(payment_data)?, @@ -744,7 +670,6 @@ pub async fn perform_eligibility_analysis( chosen, backend_input, eligible_connectors, - #[cfg(feature = "business_profile_routing")] profile_id, &api_enums::TransactionType::from(transaction_data), ) @@ -756,13 +681,10 @@ pub async fn perform_fallback_routing( key_store: &domain::MerchantKeyStore, transaction_data: &routing::TransactionData<'_, F>, eligible_connectors: Option<&Vec>, - #[cfg(feature = "business_profile_routing")] profile_id: Option, + profile_id: Option, ) -> RoutingResult> { let fallback_config = routing_helpers::get_merchant_default_config( &*state.store, - #[cfg(not(feature = "profile_specific_fallback_routing"))] - &key_store.merchant_id, - #[cfg(feature = "profile_specific_fallback_routing")] match transaction_data { routing::TransactionData::Payment(payment_data) => payment_data .payment_intent @@ -790,7 +712,6 @@ pub async fn perform_fallback_routing( fallback_config, backend_input, eligible_connectors, - #[cfg(feature = "business_profile_routing")] profile_id, &api_enums::TransactionType::from(transaction_data), ) @@ -803,7 +724,7 @@ pub async fn perform_eligibility_analysis_with_fallback( chosen: Vec, transaction_data: &routing::TransactionData<'_, F>, eligible_connectors: Option>, - #[cfg(feature = "business_profile_routing")] profile_id: Option, + profile_id: Option, ) -> RoutingResult> { let mut final_selection = perform_eligibility_analysis( state, @@ -811,7 +732,6 @@ pub async fn perform_eligibility_analysis_with_fallback( chosen, transaction_data, eligible_connectors.as_ref(), - #[cfg(feature = "business_profile_routing")] profile_id.clone(), ) .await?; @@ -821,7 +741,6 @@ pub async fn perform_eligibility_analysis_with_fallback( key_store, transaction_data, eligible_connectors.as_ref(), - #[cfg(feature = "business_profile_routing")] profile_id, ) .await; @@ -854,7 +773,6 @@ pub async fn perform_session_flow_routing( let mut pm_type_map: FxHashMap> = FxHashMap::default(); - #[cfg(feature = "business_profile_routing")] let routing_algorithm: MerchantAccountRoutingAlgorithm = { let profile_id = session_input .payment_intent @@ -879,18 +797,6 @@ pub async fn perform_session_flow_routing( .unwrap_or_default() }; - #[cfg(not(feature = "business_profile_routing"))] - let routing_algorithm: MerchantAccountRoutingAlgorithm = { - session_input - .merchant_account - .routing_algorithm - .clone() - .map(|val| val.parse_value("MerchantAccountRoutingAlgorithm")) - .transpose() - .change_context(errors::RoutingError::InvalidRoutingAlgorithmStructure)? - .unwrap_or_default() - }; - let payment_method_input = dsl_inputs::PaymentMethodInput { payment_method: None, payment_method_type: None, @@ -973,10 +879,7 @@ pub async fn perform_session_flow_routing( routing_algorithm: &routing_algorithm, backend_input: backend_input.clone(), allowed_connectors, - #[cfg(any( - feature = "business_profile_routing", - feature = "profile_specific_fallback_routing" - ))] + profile_id: session_input.payment_intent.profile_id.clone(), }; let routable_connector_choice_option = @@ -992,19 +895,12 @@ pub async fn perform_session_flow_routing( &session_pm_input.state.clone().conf.connectors, &connector_name, get_token.clone(), - #[cfg(feature = "connector_choice_mca_id")] selection.merchant_connector_id, - #[cfg(not(feature = "connector_choice_mca_id"))] - None, ) .change_context(errors::RoutingError::InvalidConnectorName(connector_name))?; - #[cfg(not(feature = "connector_choice_mca_id"))] - let sub_label = selection.sub_label; session_routing_choice.push(routing_types::SessionRoutingChoice { connector: connector_data, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: sub_label, payment_method_type: pm_type, }); } @@ -1031,7 +927,6 @@ async fn perform_session_routing_for_pm_type( &session_pm_input.state.clone(), merchant_id, algorithm_id, - #[cfg(feature = "business_profile_routing")] session_pm_input.profile_id.clone(), transaction_type, ) @@ -1052,16 +947,11 @@ async fn perform_session_routing_for_pm_type( } else { routing_helpers::get_merchant_default_config( &*session_pm_input.state.clone().store, - #[cfg(not(feature = "profile_specific_fallback_routing"))] - merchant_id, - #[cfg(feature = "profile_specific_fallback_routing")] - { - session_pm_input - .profile_id - .as_ref() - .get_required_value("profile_id") - .change_context(errors::RoutingError::ProfileIdMissing)? - }, + session_pm_input + .profile_id + .as_ref() + .get_required_value("profile_id") + .change_context(errors::RoutingError::ProfileIdMissing)?, transaction_type, ) .await @@ -1076,7 +966,6 @@ async fn perform_session_routing_for_pm_type( chosen_connectors, session_pm_input.backend_input.clone(), None, - #[cfg(feature = "business_profile_routing")] session_pm_input.profile_id.clone(), transaction_type, ) @@ -1085,16 +974,11 @@ async fn perform_session_routing_for_pm_type( if final_selection.is_empty() { let fallback = routing_helpers::get_merchant_default_config( &*session_pm_input.state.clone().store, - #[cfg(not(feature = "profile_specific_fallback_routing"))] - merchant_id, - #[cfg(feature = "profile_specific_fallback_routing")] - { - session_pm_input - .profile_id - .as_ref() - .get_required_value("profile_id") - .change_context(errors::RoutingError::ProfileIdMissing)? - }, + session_pm_input + .profile_id + .as_ref() + .get_required_value("profile_id") + .change_context(errors::RoutingError::ProfileIdMissing)?, transaction_type, ) .await @@ -1106,7 +990,6 @@ async fn perform_session_routing_for_pm_type( fallback, session_pm_input.backend_input.clone(), None, - #[cfg(feature = "business_profile_routing")] session_pm_input.profile_id.clone(), transaction_type, ) diff --git a/crates/router/src/core/payments/routing/transformers.rs b/crates/router/src/core/payments/routing/transformers.rs index ae779a6551f0..abe3fbd01b22 100644 --- a/crates/router/src/core/payments/routing/transformers.rs +++ b/crates/router/src/core/payments/routing/transformers.rs @@ -13,11 +13,7 @@ use crate::{ impl ForeignFrom for dsl_ast::ConnectorChoice { fn foreign_from(from: routing_types::RoutableConnectorChoice) -> Self { Self { - // #[cfg(feature = "backwards_compatibility")] - // choice_kind: from.choice_kind.foreign_into(), connector: from.connector, - #[cfg(not(feature = "connector_choice_mca_id"))] - sub_label: from.sub_label, } } } diff --git a/crates/router/src/core/payouts.rs b/crates/router/src/core/payouts.rs index e36036eb798c..4365519aecc4 100644 --- a/crates/router/src/core/payouts.rs +++ b/crates/router/src/core/payouts.rs @@ -112,10 +112,7 @@ pub async fn get_connector_choice( payout_data.payout_attempt.routing_info = Some(straight_through); let mut routing_data = storage::RoutingData { routed_through: connector, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id: None, - #[cfg(not(feature = "connector_choice_mca_id"))] - business_sub_label: payout_data.payout_attempt.business_label.clone(), algorithm: Some(request_straight_through.clone()), routing_info: PaymentRoutingInfo { algorithm: None, @@ -137,10 +134,7 @@ pub async fn get_connector_choice( api::ConnectorChoice::Decide => { let mut routing_data = storage::RoutingData { routed_through: connector, - #[cfg(feature = "connector_choice_mca_id")] merchant_connector_id: None, - #[cfg(not(feature = "connector_choice_mca_id"))] - business_sub_label: payout_data.payout_attempt.business_label.clone(), algorithm: None, routing_info: PaymentRoutingInfo { algorithm: None, diff --git a/crates/router/src/core/payouts/helpers.rs b/crates/router/src/core/payouts/helpers.rs index 5d70e0092175..3ab171432022 100644 --- a/crates/router/src/core/payouts/helpers.rs +++ b/crates/router/src/core/payouts/helpers.rs @@ -690,7 +690,6 @@ pub async fn decide_payout_connector( connectors, &TransactionData::<()>::Payout(payout_data), eligible_connectors, - #[cfg(feature = "business_profile_routing")] Some(payout_attempt.profile_id.clone()), ) .await @@ -711,10 +710,7 @@ pub async fn decide_payout_connector( &state.conf.connectors, &conn.connector.to_string(), api::GetToken::Connector, - #[cfg(feature = "connector_choice_mca_id")] payout_attempt.merchant_connector_id.clone(), - #[cfg(not(feature = "connector_choice_mca_id"))] - None, ) }) .collect::, _>>() @@ -722,14 +718,8 @@ pub async fn decide_payout_connector( .attach_printable("Invalid connector name received")?; routing_data.routed_through = Some(first_connector_choice.connector.to_string()); - #[cfg(feature = "connector_choice_mca_id")] - { - routing_data.merchant_connector_id = first_connector_choice.merchant_connector_id; - } - #[cfg(not(feature = "connector_choice_mca_id"))] - { - routing_data.business_sub_label = first_connector_choice.sub_label.clone(); - } + routing_data.merchant_connector_id = first_connector_choice.merchant_connector_id; + routing_data.routing_info.algorithm = Some(routing_algorithm); return Ok(api::ConnectorCallType::Retryable(connector_data)); } @@ -748,7 +738,6 @@ pub async fn decide_payout_connector( connectors, &TransactionData::<()>::Payout(payout_data), eligible_connectors, - #[cfg(feature = "business_profile_routing")] Some(payout_attempt.profile_id.clone()), ) .await @@ -771,10 +760,7 @@ pub async fn decide_payout_connector( &state.conf.connectors, &conn.connector.to_string(), api::GetToken::Connector, - #[cfg(feature = "connector_choice_mca_id")] payout_attempt.merchant_connector_id.clone(), - #[cfg(not(feature = "connector_choice_mca_id"))] - None, ) }) .collect::, _>>() @@ -782,14 +768,8 @@ pub async fn decide_payout_connector( .attach_printable("Invalid connector name received")?; routing_data.routed_through = Some(first_connector_choice.connector.to_string()); - #[cfg(feature = "connector_choice_mca_id")] - { - routing_data.merchant_connector_id = first_connector_choice.merchant_connector_id; - } - #[cfg(not(feature = "connector_choice_mca_id"))] - { - routing_data.business_sub_label = first_connector_choice.sub_label.clone(); - } + routing_data.merchant_connector_id = first_connector_choice.merchant_connector_id; + return Ok(api::ConnectorCallType::Retryable(connector_data)); } diff --git a/crates/router/src/core/routing.rs b/crates/router/src/core/routing.rs index c2312fe22456..5f10de56e471 100644 --- a/crates/router/src/core/routing.rs +++ b/crates/router/src/core/routing.rs @@ -1,42 +1,33 @@ pub mod helpers; pub mod transformers; -#[cfg(feature = "business_profile_routing")] -use api_models::routing::{RoutingRetrieveLinkQuery, RoutingRetrieveQuery}; use api_models::{ enums, - routing::{self as routing_types, RoutingAlgorithmId}, + routing::{ + self as routing_types, RoutingAlgorithmId, RoutingRetrieveLinkQuery, RoutingRetrieveQuery, + }, }; -#[cfg(not(feature = "business_profile_routing"))] -use common_utils::ext_traits::{Encode, StringExt}; -#[cfg(not(feature = "business_profile_routing"))] -use diesel_models::configs; -#[cfg(feature = "business_profile_routing")] use diesel_models::routing_algorithm::RoutingAlgorithm; use error_stack::ResultExt; use rustc_hash::FxHashSet; -#[cfg(not(feature = "business_profile_routing"))] -use storage_impl::redis::cache; use super::payments; #[cfg(feature = "payouts")] use super::payouts; -#[cfg(feature = "business_profile_routing")] -use crate::types::transformers::{ForeignInto, ForeignTryFrom}; use crate::{ consts, core::{ - errors::{RouterResponse, StorageErrorExt}, + errors::{self, RouterResponse, StorageErrorExt}, metrics, utils as core_utils, }, routes::SessionState, - types::domain, + services::api as service_api, + types::{ + domain, + transformers::{ForeignInto, ForeignTryFrom}, + }, utils::{self, OptionExt, ValueExt}, }; -#[cfg(not(feature = "business_profile_routing"))] -use crate::{core::errors, services::api as service_api, types::storage}; -#[cfg(feature = "business_profile_routing")] -use crate::{errors, services::api as service_api}; pub enum TransactionData<'a, F> where @@ -50,47 +41,29 @@ where pub async fn retrieve_merchant_routing_dictionary( state: SessionState, merchant_account: domain::MerchantAccount, - #[cfg(feature = "business_profile_routing")] query_params: RoutingRetrieveQuery, - #[cfg(feature = "business_profile_routing")] transaction_type: &enums::TransactionType, + query_params: RoutingRetrieveQuery, + transaction_type: &enums::TransactionType, ) -> RouterResponse { metrics::ROUTING_MERCHANT_DICTIONARY_RETRIEVE.add(&metrics::CONTEXT, 1, &[]); - #[cfg(feature = "business_profile_routing")] - { - let routing_metadata = state - .store - .list_routing_algorithm_metadata_by_merchant_id_transaction_type( - &merchant_account.merchant_id, - transaction_type, - i64::from(query_params.limit.unwrap_or_default()), - i64::from(query_params.offset.unwrap_or_default()), - ) - .await - .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; - let result = routing_metadata - .into_iter() - .map(ForeignInto::foreign_into) - .collect::>(); - - metrics::ROUTING_MERCHANT_DICTIONARY_RETRIEVE_SUCCESS_RESPONSE.add( - &metrics::CONTEXT, - 1, - &[], - ); - Ok(service_api::ApplicationResponse::Json( - routing_types::RoutingKind::RoutingAlgorithm(result), - )) - } - #[cfg(not(feature = "business_profile_routing"))] + + let routing_metadata = state + .store + .list_routing_algorithm_metadata_by_merchant_id_transaction_type( + &merchant_account.merchant_id, + transaction_type, + i64::from(query_params.limit.unwrap_or_default()), + i64::from(query_params.offset.unwrap_or_default()), + ) + .await + .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; + let result = routing_metadata + .into_iter() + .map(ForeignInto::foreign_into) + .collect::>(); + metrics::ROUTING_MERCHANT_DICTIONARY_RETRIEVE_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - #[cfg(not(feature = "business_profile_routing"))] Ok(service_api::ApplicationResponse::Json( - routing_types::RoutingKind::Config( - helpers::get_merchant_routing_dictionary( - state.store.as_ref(), - &merchant_account.merchant_id, - ) - .await?, - ), + routing_types::RoutingKind::RoutingAlgorithm(result), )) } @@ -131,251 +104,121 @@ pub async fn create_routing_config( &format!("routing_{}", &merchant_account.merchant_id), ); - #[cfg(feature = "business_profile_routing")] - { - let profile_id = request - .profile_id - .get_required_value("profile_id") - .change_context(errors::ApiErrorResponse::MissingRequiredField { - field_name: "profile_id", - }) - .attach_printable("Profile_id not provided")?; - - core_utils::validate_and_get_business_profile( - db, - Some(&profile_id), - &merchant_account.merchant_id, - ) - .await?; - - helpers::validate_connectors_in_routing_config( - db, - &key_store, - &merchant_account.merchant_id, - &profile_id, - &algorithm, - ) - .await?; - - let timestamp = common_utils::date_time::now(); - let algo = RoutingAlgorithm { - algorithm_id: algorithm_id.clone(), - profile_id, - merchant_id: merchant_account.merchant_id, - name: name.clone(), - description: Some(description.clone()), - kind: algorithm.get_kind().foreign_into(), - algorithm_data: serde_json::json!(algorithm), - created_at: timestamp, - modified_at: timestamp, - algorithm_for: transaction_type.to_owned(), - }; - let record = db - .insert_routing_algorithm(algo) - .await - .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; - - let new_record = record.foreign_into(); - - metrics::ROUTING_CREATE_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - Ok(service_api::ApplicationResponse::Json(new_record)) - } - - #[cfg(not(feature = "business_profile_routing"))] - { - let algorithm_str = algorithm - .encode_to_string_of_json() - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Unable to serialize routing algorithm to string")?; - - let mut algorithm_ref: routing_types::RoutingAlgorithmRef = merchant_account - .routing_algorithm - .clone() - .map(|val| val.parse_value("RoutingAlgorithmRef")) - .transpose() - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("unable to deserialize routing algorithm ref from merchant account")? - .unwrap_or_default(); - let mut merchant_dictionary = - helpers::get_merchant_routing_dictionary(db, &merchant_account.merchant_id).await?; - - utils::when( - merchant_dictionary.records.len() >= consts::MAX_ROUTING_CONFIGS_PER_MERCHANT, - || { - Err(errors::ApiErrorResponse::PreconditionFailed { - message: format!("Reached the maximum number of routing configs ({}), please delete some to create new ones", consts::MAX_ROUTING_CONFIGS_PER_MERCHANT), + let profile_id = request + .profile_id + .get_required_value("profile_id") + .change_context(errors::ApiErrorResponse::MissingRequiredField { + field_name: "profile_id", }) - }, - )?; - let timestamp = common_utils::date_time::now_unix_timestamp(); - let records_are_empty = merchant_dictionary.records.is_empty(); - - let new_record = routing_types::RoutingDictionaryRecord { - id: algorithm_id.clone(), - name: name.clone(), - kind: algorithm.get_kind(), - description: description.clone(), - created_at: timestamp, - modified_at: timestamp, - algorithm_for: Some(*transaction_type), - }; - merchant_dictionary.records.push(new_record.clone()); - - let new_algorithm_config = configs::ConfigNew { - key: algorithm_id.clone(), - config: algorithm_str, - }; - - db.insert_config(new_algorithm_config) - .await - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed to save new routing algorithm config to DB")?; + .attach_printable("Profile_id not provided")?; - if records_are_empty { - merchant_dictionary.active_id = Some(algorithm_id.clone()); - algorithm_ref.update_algorithm_id(algorithm_id); - let key = - cache::CacheKind::Routing(format!("dsl_{}", &merchant_account.merchant_id).into()); + core_utils::validate_and_get_business_profile( + db, + Some(&profile_id), + &merchant_account.merchant_id, + ) + .await?; - helpers::update_merchant_active_algorithm_ref(db, &key_store, key, algorithm_ref) - .await?; - } + helpers::validate_connectors_in_routing_config( + db, + &key_store, + &merchant_account.merchant_id, + &profile_id, + &algorithm, + ) + .await?; - helpers::update_merchant_routing_dictionary( - db, - &merchant_account.merchant_id, - merchant_dictionary, - ) - .await?; + let timestamp = common_utils::date_time::now(); + let algo = RoutingAlgorithm { + algorithm_id: algorithm_id.clone(), + profile_id, + merchant_id: merchant_account.merchant_id, + name: name.clone(), + description: Some(description.clone()), + kind: algorithm.get_kind().foreign_into(), + algorithm_data: serde_json::json!(algorithm), + created_at: timestamp, + modified_at: timestamp, + algorithm_for: transaction_type.to_owned(), + }; + let record = db + .insert_routing_algorithm(algo) + .await + .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; - metrics::ROUTING_CREATE_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - Ok(service_api::ApplicationResponse::Json(new_record)) - } + let new_record = record.foreign_into(); + + metrics::ROUTING_CREATE_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); + Ok(service_api::ApplicationResponse::Json(new_record)) } pub async fn link_routing_config( state: SessionState, merchant_account: domain::MerchantAccount, - #[cfg(not(feature = "business_profile_routing"))] key_store: domain::MerchantKeyStore, algorithm_id: String, transaction_type: &enums::TransactionType, ) -> RouterResponse { metrics::ROUTING_LINK_CONFIG.add(&metrics::CONTEXT, 1, &[]); let db = state.store.as_ref(); - #[cfg(feature = "business_profile_routing")] - { - let routing_algorithm = db - .find_routing_algorithm_by_algorithm_id_merchant_id( - &algorithm_id, - &merchant_account.merchant_id, - ) - .await - .change_context(errors::ApiErrorResponse::ResourceIdNotFound)?; - let business_profile = core_utils::validate_and_get_business_profile( - db, - Some(&routing_algorithm.profile_id), + let routing_algorithm = db + .find_routing_algorithm_by_algorithm_id_merchant_id( + &algorithm_id, &merchant_account.merchant_id, ) - .await? - .get_required_value("BusinessProfile") - .change_context(errors::ApiErrorResponse::BusinessProfileNotFound { - id: routing_algorithm.profile_id.clone(), - })?; + .await + .change_context(errors::ApiErrorResponse::ResourceIdNotFound)?; - let mut routing_ref: routing_types::RoutingAlgorithmRef = match transaction_type { - enums::TransactionType::Payment => business_profile.routing_algorithm.clone(), - #[cfg(feature = "payouts")] - enums::TransactionType::Payout => business_profile.payout_routing_algorithm.clone(), - } + let business_profile = core_utils::validate_and_get_business_profile( + db, + Some(&routing_algorithm.profile_id), + &merchant_account.merchant_id, + ) + .await? + .get_required_value("BusinessProfile") + .change_context(errors::ApiErrorResponse::BusinessProfileNotFound { + id: routing_algorithm.profile_id.clone(), + })?; + + let mut routing_ref: routing_types::RoutingAlgorithmRef = business_profile + .routing_algorithm + .clone() .map(|val| val.parse_value("RoutingAlgorithmRef")) .transpose() .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("unable to deserialize routing algorithm ref from merchant account")? .unwrap_or_default(); - utils::when(routing_algorithm.algorithm_for != *transaction_type, || { + utils::when(routing_algorithm.algorithm_for != *transaction_type, || { + Err(errors::ApiErrorResponse::PreconditionFailed { + message: format!( + "Cannot use {}'s routing algorithm for {} operation", + routing_algorithm.algorithm_for, transaction_type + ), + }) + })?; + + utils::when( + routing_ref.algorithm_id == Some(algorithm_id.clone()), + || { Err(errors::ApiErrorResponse::PreconditionFailed { - message: format!( - "Cannot use {}'s routing algorithm for {} operation", - routing_algorithm.algorithm_for, transaction_type - ), + message: "Algorithm is already active".to_string(), }) - })?; - - utils::when( - routing_ref.algorithm_id == Some(algorithm_id.clone()), - || { - Err(errors::ApiErrorResponse::PreconditionFailed { - message: "Algorithm is already active".to_string(), - }) - }, - )?; - - routing_ref.update_algorithm_id(algorithm_id); - helpers::update_business_profile_active_algorithm_ref( - db, - business_profile, - routing_ref, - transaction_type, - ) - .await?; - - metrics::ROUTING_LINK_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - Ok(service_api::ApplicationResponse::Json( - routing_algorithm.foreign_into(), - )) - } - - #[cfg(not(feature = "business_profile_routing"))] - { - let mut routing_ref: routing_types::RoutingAlgorithmRef = match transaction_type { - enums::TransactionType::Payment => merchant_account.routing_algorithm.clone(), - #[cfg(feature = "payouts")] - enums::TransactionType::Payout => merchant_account.payout_routing_algorithm.clone(), - } - .map(|val| val.parse_value("RoutingAlgorithmRef")) - .transpose() - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("unable to deserialize routing algorithm ref from merchant account")? - .unwrap_or_default(); - - utils::when( - routing_ref.algorithm_id == Some(algorithm_id.clone()), - || { - Err(errors::ApiErrorResponse::PreconditionFailed { - message: "Algorithm is already active".to_string(), - }) - }, - )?; - let mut merchant_dictionary = - helpers::get_merchant_routing_dictionary(db, &merchant_account.merchant_id).await?; - - let modified_at = common_utils::date_time::now_unix_timestamp(); - let record = merchant_dictionary - .records - .iter_mut() - .find(|rec| rec.id == algorithm_id) - .ok_or(errors::ApiErrorResponse::ResourceIdNotFound) - .attach_printable("Record with given ID not found for routing config activation")?; - - record.modified_at = modified_at; - merchant_dictionary.active_id = Some(record.id.clone()); - let response = record.clone(); - routing_ref.update_algorithm_id(algorithm_id); - helpers::update_merchant_routing_dictionary( - db, - &merchant_account.merchant_id, - merchant_dictionary, - ) - .await?; - let key = - cache::CacheKind::Routing(format!("dsl_{}", &merchant_account.merchant_id).into()); - helpers::update_merchant_active_algorithm_ref(db, &key_store, key, routing_ref).await?; + }, + )?; + routing_ref.update_algorithm_id(algorithm_id); + helpers::update_business_profile_active_algorithm_ref( + db, + business_profile, + routing_ref, + transaction_type, + ) + .await?; - metrics::ROUTING_LINK_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - Ok(service_api::ApplicationResponse::Json(response)) - } + metrics::ROUTING_LINK_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); + Ok(service_api::ApplicationResponse::Json( + routing_algorithm.foreign_into(), + )) } pub async fn retrieve_routing_config( @@ -385,256 +228,105 @@ pub async fn retrieve_routing_config( ) -> RouterResponse { metrics::ROUTING_RETRIEVE_CONFIG.add(&metrics::CONTEXT, 1, &[]); let db = state.store.as_ref(); - #[cfg(feature = "business_profile_routing")] - { - let routing_algorithm = db - .find_routing_algorithm_by_algorithm_id_merchant_id( - &algorithm_id.0, - &merchant_account.merchant_id, - ) - .await - .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; - core_utils::validate_and_get_business_profile( - db, - Some(&routing_algorithm.profile_id), + let routing_algorithm = db + .find_routing_algorithm_by_algorithm_id_merchant_id( + &algorithm_id.0, &merchant_account.merchant_id, ) - .await? - .get_required_value("BusinessProfile") - .change_context(errors::ApiErrorResponse::ResourceIdNotFound)?; - - let response = routing_types::MerchantRoutingAlgorithm::foreign_try_from(routing_algorithm) - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("unable to parse routing algorithm")?; - - metrics::ROUTING_RETRIEVE_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - Ok(service_api::ApplicationResponse::Json(response)) - } - - #[cfg(not(feature = "business_profile_routing"))] - { - let merchant_dictionary = - helpers::get_merchant_routing_dictionary(db, &merchant_account.merchant_id).await?; + .await + .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; - let record = merchant_dictionary - .records - .into_iter() - .find(|rec| rec.id == algorithm_id.0) - .ok_or(errors::ApiErrorResponse::ResourceIdNotFound) - .attach_printable("Algorithm with the given ID not found in the merchant dictionary")?; + core_utils::validate_and_get_business_profile( + db, + Some(&routing_algorithm.profile_id), + &merchant_account.merchant_id, + ) + .await? + .get_required_value("BusinessProfile") + .change_context(errors::ApiErrorResponse::ResourceIdNotFound)?; - let algorithm_config = db - .find_config_by_key(&algorithm_id.0) - .await - .change_context(errors::ApiErrorResponse::ResourceIdNotFound) - .attach_printable("Routing config not found in DB")?; + let response = routing_types::MerchantRoutingAlgorithm::foreign_try_from(routing_algorithm) + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("unable to parse routing algorithm")?; - let algorithm: routing_types::RoutingAlgorithm = algorithm_config - .config - .parse_struct("RoutingAlgorithm") - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Error deserializing routing algorithm config")?; - - let response = routing_types::MerchantRoutingAlgorithm { - id: record.id, - name: record.name, - description: record.description, - algorithm, - created_at: record.created_at, - modified_at: record.modified_at, - algorithm_for: record - .algorithm_for - .unwrap_or(enums::TransactionType::Payment), - }; - - metrics::ROUTING_RETRIEVE_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - Ok(service_api::ApplicationResponse::Json(response)) - } + metrics::ROUTING_RETRIEVE_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); + Ok(service_api::ApplicationResponse::Json(response)) } pub async fn unlink_routing_config( state: SessionState, merchant_account: domain::MerchantAccount, - #[cfg(not(feature = "business_profile_routing"))] key_store: domain::MerchantKeyStore, - #[cfg(feature = "business_profile_routing")] request: routing_types::RoutingConfigRequest, + request: routing_types::RoutingConfigRequest, transaction_type: &enums::TransactionType, ) -> RouterResponse { metrics::ROUTING_UNLINK_CONFIG.add(&metrics::CONTEXT, 1, &[]); let db = state.store.as_ref(); - #[cfg(feature = "business_profile_routing")] - { - let profile_id = request - .profile_id - .get_required_value("profile_id") - .change_context(errors::ApiErrorResponse::MissingRequiredField { - field_name: "profile_id", - }) - .attach_printable("Profile_id not provided")?; - let business_profile = core_utils::validate_and_get_business_profile( - db, - Some(&profile_id), - &merchant_account.merchant_id, - ) - .await?; - match business_profile { - Some(business_profile) => { - let routing_algo_ref: routing_types::RoutingAlgorithmRef = match transaction_type { - enums::TransactionType::Payment => business_profile.routing_algorithm.clone(), - #[cfg(feature = "payouts")] - enums::TransactionType::Payout => { - business_profile.payout_routing_algorithm.clone() - } - } - .map(|val| val.parse_value("RoutingAlgorithmRef")) - .transpose() - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable( - "unable to deserialize routing algorithm ref from merchant account", - )? - .unwrap_or_default(); - - let timestamp = common_utils::date_time::now_unix_timestamp(); - - match routing_algo_ref.algorithm_id { - Some(algorithm_id) => { - let routing_algorithm: routing_types::RoutingAlgorithmRef = - routing_types::RoutingAlgorithmRef { - algorithm_id: None, - timestamp, - config_algo_id: routing_algo_ref.config_algo_id.clone(), - surcharge_config_algo_id: routing_algo_ref.surcharge_config_algo_id, - }; - - let record = db - .find_routing_algorithm_by_profile_id_algorithm_id( - &profile_id, - &algorithm_id, - ) - .await - .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; - let response = record.foreign_into(); - helpers::update_business_profile_active_algorithm_ref( - db, - business_profile, - routing_algorithm, - transaction_type, + let profile_id = request + .profile_id + .get_required_value("profile_id") + .change_context(errors::ApiErrorResponse::MissingRequiredField { + field_name: "profile_id", + }) + .attach_printable("Profile_id not provided")?; + let business_profile = core_utils::validate_and_get_business_profile( + db, + Some(&profile_id), + &merchant_account.merchant_id, + ) + .await?; + match business_profile { + Some(business_profile) => { + let routing_algo_ref: routing_types::RoutingAlgorithmRef = match transaction_type { + enums::TransactionType::Payment => business_profile.routing_algorithm.clone(), + #[cfg(feature = "payouts")] + enums::TransactionType::Payout => business_profile.payout_routing_algorithm.clone(), + } + .map(|val| val.parse_value("RoutingAlgorithmRef")) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("unable to deserialize routing algorithm ref from merchant account")? + .unwrap_or_default(); + + let timestamp = common_utils::date_time::now_unix_timestamp(); + + match routing_algo_ref.algorithm_id { + Some(algorithm_id) => { + let routing_algorithm: routing_types::RoutingAlgorithmRef = + routing_types::RoutingAlgorithmRef { + algorithm_id: None, + timestamp, + config_algo_id: routing_algo_ref.config_algo_id.clone(), + surcharge_config_algo_id: routing_algo_ref.surcharge_config_algo_id, + }; + + let record = db + .find_routing_algorithm_by_profile_id_algorithm_id( + &profile_id, + &algorithm_id, ) - .await?; - - metrics::ROUTING_UNLINK_CONFIG_SUCCESS_RESPONSE.add( - &metrics::CONTEXT, - 1, - &[], - ); - Ok(service_api::ApplicationResponse::Json(response)) - } - None => Err(errors::ApiErrorResponse::PreconditionFailed { - message: "Algorithm is already inactive".to_string(), - })?, + .await + .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; + let response = record.foreign_into(); + helpers::update_business_profile_active_algorithm_ref( + db, + business_profile, + routing_algorithm, + transaction_type, + ) + .await?; + + metrics::ROUTING_UNLINK_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); + Ok(service_api::ApplicationResponse::Json(response)) } + None => Err(errors::ApiErrorResponse::PreconditionFailed { + message: "Algorithm is already inactive".to_string(), + })?, } - None => Err(errors::ApiErrorResponse::InvalidRequestData { - message: "The business_profile is not present".to_string(), - } - .into()), } - } - - #[cfg(not(feature = "business_profile_routing"))] - { - let mut merchant_dictionary = - helpers::get_merchant_routing_dictionary(db, &merchant_account.merchant_id).await?; - - let routing_algo_ref: routing_types::RoutingAlgorithmRef = match transaction_type { - enums::TransactionType::Payment => merchant_account.routing_algorithm.clone(), - #[cfg(feature = "payouts")] - enums::TransactionType::Payout => merchant_account.payout_routing_algorithm.clone(), + None => Err(errors::ApiErrorResponse::InvalidRequestData { + message: "The business_profile is not present".to_string(), } - .map(|val| val.parse_value("RoutingAlgorithmRef")) - .transpose() - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("unable to deserialize routing algorithm ref from merchant account")? - .unwrap_or_default(); - let timestamp = common_utils::date_time::now_unix_timestamp(); - - utils::when(routing_algo_ref.algorithm_id.is_none(), || { - Err(errors::ApiErrorResponse::PreconditionFailed { - message: "Algorithm is already inactive".to_string(), - }) - })?; - let routing_algorithm: routing_types::RoutingAlgorithmRef = - routing_types::RoutingAlgorithmRef { - algorithm_id: None, - timestamp, - config_algo_id: routing_algo_ref.config_algo_id.clone(), - surcharge_config_algo_id: routing_algo_ref.surcharge_config_algo_id, - }; - - let active_algorithm_id = merchant_dictionary - .active_id - .or(routing_algo_ref.algorithm_id.clone()) - .ok_or(errors::ApiErrorResponse::PreconditionFailed { - // When the merchant_dictionary doesn't have any active algorithm and merchant_account doesn't have any routing_algorithm configured - message: "Algorithm is already inactive".to_string(), - })?; - - let record = merchant_dictionary - .records - .iter_mut() - .find(|rec| rec.id == active_algorithm_id) - .ok_or(errors::ApiErrorResponse::ResourceIdNotFound) - .attach_printable("Record with the given ID not found for de-activation")?; - - let response = record.clone(); - - merchant_dictionary.active_id = None; - - helpers::update_merchant_routing_dictionary( - db, - &merchant_account.merchant_id, - merchant_dictionary, - ) - .await?; - - let ref_value = routing_algorithm - .encode_to_value() - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed converting routing algorithm ref to json value")?; - - let merchant_account_update = storage::MerchantAccountUpdate::Update { - merchant_name: None, - merchant_details: None, - return_url: None, - webhook_details: None, - sub_merchants_enabled: None, - parent_merchant_id: None, - enable_payment_response_hash: None, - payment_response_hash_key: None, - redirect_to_merchant_with_http_post: None, - publishable_key: None, - locker_id: None, - metadata: None, - routing_algorithm: Some(ref_value), - primary_business_details: None, - intent_fulfillment_time: None, - frm_routing_algorithm: None, - payout_routing_algorithm: None, - default_profile: None, - payment_link_config: None, - pm_collect_link_config: None, - }; - - db.update_specific_fields_in_merchant( - &key_store.merchant_id, - merchant_account_update, - &key_store, - ) - .await - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed to update routing algorithm ref in merchant account")?; - - metrics::ROUTING_UNLINK_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - Ok(service_api::ApplicationResponse::Json(response)) + .into()), } } @@ -710,110 +402,60 @@ pub async fn retrieve_default_routing_config( pub async fn retrieve_linked_routing_config( state: SessionState, merchant_account: domain::MerchantAccount, - #[cfg(feature = "business_profile_routing")] query_params: RoutingRetrieveLinkQuery, - #[cfg(feature = "business_profile_routing")] transaction_type: &enums::TransactionType, + query_params: RoutingRetrieveLinkQuery, + transaction_type: &enums::TransactionType, ) -> RouterResponse { metrics::ROUTING_RETRIEVE_LINK_CONFIG.add(&metrics::CONTEXT, 1, &[]); let db = state.store.as_ref(); - #[cfg(feature = "business_profile_routing")] - { - let business_profiles = if let Some(profile_id) = query_params.profile_id { - core_utils::validate_and_get_business_profile( - db, - Some(&profile_id), - &merchant_account.merchant_id, - ) - .await? - .map(|profile| vec![profile]) - .get_required_value("BusinessProfile") - .change_context(errors::ApiErrorResponse::BusinessProfileNotFound { id: profile_id })? - } else { - db.list_business_profile_by_merchant_id(&merchant_account.merchant_id) - .await - .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)? - }; - - let mut active_algorithms = Vec::new(); - - for business_profile in business_profiles { - let routing_ref: routing_types::RoutingAlgorithmRef = match transaction_type { - enums::TransactionType::Payment => business_profile.routing_algorithm, - #[cfg(feature = "payouts")] - enums::TransactionType::Payout => business_profile.payout_routing_algorithm, - } - .clone() - .map(|val| val.parse_value("RoutingAlgorithmRef")) - .transpose() - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("unable to deserialize routing algorithm ref from merchant account")? - .unwrap_or_default(); + let business_profiles = if let Some(profile_id) = query_params.profile_id { + core_utils::validate_and_get_business_profile( + db, + Some(&profile_id), + &merchant_account.merchant_id, + ) + .await? + .map(|profile| vec![profile]) + .get_required_value("BusinessProfile") + .change_context(errors::ApiErrorResponse::BusinessProfileNotFound { id: profile_id })? + } else { + db.list_business_profile_by_merchant_id(&merchant_account.merchant_id) + .await + .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)? + }; - if let Some(algorithm_id) = routing_ref.algorithm_id { - let record = db - .find_routing_algorithm_metadata_by_algorithm_id_profile_id( - &algorithm_id, - &business_profile.profile_id, - ) - .await - .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; + let mut active_algorithms = Vec::new(); - active_algorithms.push(record.foreign_into()); - } + for business_profile in business_profiles { + let routing_ref: routing_types::RoutingAlgorithmRef = match transaction_type { + enums::TransactionType::Payment => business_profile.routing_algorithm, + #[cfg(feature = "payouts")] + enums::TransactionType::Payout => business_profile.payout_routing_algorithm, } + .clone() + .map(|val| val.parse_value("RoutingAlgorithmRef")) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("unable to deserialize routing algorithm ref from merchant account")? + .unwrap_or_default(); - metrics::ROUTING_RETRIEVE_LINK_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - Ok(service_api::ApplicationResponse::Json( - routing_types::LinkedRoutingConfigRetrieveResponse::ProfileBased(active_algorithms), - )) - } - #[cfg(not(feature = "business_profile_routing"))] - { - let merchant_dictionary = - helpers::get_merchant_routing_dictionary(db, &merchant_account.merchant_id).await?; - - let algorithm = if let Some(algorithm_id) = merchant_dictionary.active_id { - let record = merchant_dictionary - .records - .into_iter() - .find(|rec| rec.id == algorithm_id) - .ok_or(errors::ApiErrorResponse::ResourceIdNotFound) - .attach_printable("record for active algorithm not found in merchant dictionary")?; - - let config = db - .find_config_by_key(&algorithm_id) + if let Some(algorithm_id) = routing_ref.algorithm_id { + let record = db + .find_routing_algorithm_metadata_by_algorithm_id_profile_id( + &algorithm_id, + &business_profile.profile_id, + ) .await - .to_not_found_response(errors::ApiErrorResponse::InternalServerError) - .attach_printable("error finding routing config in db")?; - - let the_algorithm: routing_types::RoutingAlgorithm = config - .config - .parse_struct("RoutingAlgorithm") - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("unable to parse routing algorithm")?; - - Some(routing_types::MerchantRoutingAlgorithm { - id: record.id, - name: record.name, - description: record.description, - algorithm: the_algorithm, - created_at: record.created_at, - modified_at: record.modified_at, - algorithm_for: record - .algorithm_for - .unwrap_or(enums::TransactionType::Payment), - }) - } else { - None - }; - - let response = routing_types::LinkedRoutingConfigRetrieveResponse::MerchantAccountBased( - routing_types::RoutingRetrieveResponse { algorithm }, - ); + .to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?; - metrics::ROUTING_RETRIEVE_LINK_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); - Ok(service_api::ApplicationResponse::Json(response)) + active_algorithms.push(record.foreign_into()); + } } + + metrics::ROUTING_RETRIEVE_LINK_CONFIG_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]); + Ok(service_api::ApplicationResponse::Json( + routing_types::LinkedRoutingConfigRetrieveResponse::ProfileBased(active_algorithms), + )) } pub async fn retrieve_default_routing_config_for_profiles( @@ -883,25 +525,17 @@ pub async fn update_default_routing_config_for_profile( }) })?; - let existing_set = FxHashSet::from_iter(default_config.iter().map(|c| { - ( - c.connector.to_string(), - #[cfg(feature = "connector_choice_mca_id")] - c.merchant_connector_id.as_ref(), - #[cfg(not(feature = "connector_choice_mca_id"))] - c.sub_label.as_ref(), - ) - })); - - let updated_set = FxHashSet::from_iter(updated_config.iter().map(|c| { - ( - c.connector.to_string(), - #[cfg(feature = "connector_choice_mca_id")] - c.merchant_connector_id.as_ref(), - #[cfg(not(feature = "connector_choice_mca_id"))] - c.sub_label.as_ref(), - ) - })); + let existing_set = FxHashSet::from_iter( + default_config + .iter() + .map(|c| (c.connector.to_string(), c.merchant_connector_id.as_ref())), + ); + + let updated_set = FxHashSet::from_iter( + updated_config + .iter() + .map(|c| (c.connector.to_string(), c.merchant_connector_id.as_ref())), + ); let symmetric_diff = existing_set .symmetric_difference(&updated_set) diff --git a/crates/router/src/core/routing/helpers.rs b/crates/router/src/core/routing/helpers.rs index 0e4adbff36b1..d99177aa5557 100644 --- a/crates/router/src/core/routing/helpers.rs +++ b/crates/router/src/core/routing/helpers.rs @@ -249,14 +249,11 @@ pub async fn update_business_profile_active_algorithm_ref( let merchant_id = current_business_profile.merchant_id.clone(); - #[cfg(feature = "business_profile_routing")] let profile_id = current_business_profile.profile_id.clone(); - #[cfg(feature = "business_profile_routing")] + let routing_cache_key = cache::CacheKind::Routing(format!("routing_config_{merchant_id}_{profile_id}").into()); - #[cfg(not(feature = "business_profile_routing"))] - let routing_cache_key = cache::CacheKind::Routing(format!("dsl_{merchant_id}").into()); let (routing_algorithm, payout_routing_algorithm) = match transaction_type { storage::enums::TransactionType::Payment => (Some(ref_val), None), #[cfg(feature = "payouts")] @@ -320,7 +317,6 @@ pub async fn validate_connectors_in_routing_config( id: merchant_id.to_string(), })?; - #[cfg(feature = "connector_choice_mca_id")] let name_mca_id_set = all_mcas .iter() .filter(|mca| mca.profile_id.as_deref() == Some(profile_id)) @@ -333,7 +329,6 @@ pub async fn validate_connectors_in_routing_config( .map(|mca| &mca.connector_name) .collect::>(); - #[cfg(feature = "connector_choice_mca_id")] let check_connector_choice = |choice: &routing_types::RoutableConnectorChoice| { if let Some(ref mca_id) = choice.merchant_connector_id { error_stack::ensure!( @@ -361,21 +356,6 @@ pub async fn validate_connectors_in_routing_config( Ok(()) }; - #[cfg(not(feature = "connector_choice_mca_id"))] - let check_connector_choice = |choice: &routing_types::RoutableConnectorChoice| { - error_stack::ensure!( - name_set.contains(&choice.connector.to_string()), - errors::ApiErrorResponse::InvalidRequestData { - message: format!( - "connector with name '{}' not found for the given profile", - choice.connector, - ) - } - ); - - Ok(()) - }; - match routing_algorithm { routing_types::RoutingAlgorithm::Single(choice) => { check_connector_choice(choice)?; diff --git a/crates/router/src/core/routing/transformers.rs b/crates/router/src/core/routing/transformers.rs index 4feca317a559..2e45605edb6a 100644 --- a/crates/router/src/core/routing/transformers.rs +++ b/crates/router/src/core/routing/transformers.rs @@ -17,7 +17,7 @@ impl ForeignFrom for RoutingDictionaryRecord { fn foreign_from(value: RoutingProfileMetadata) -> Self { Self { id: value.algorithm_id, - #[cfg(feature = "business_profile_routing")] + profile_id: value.profile_id, name: value.name, kind: value.kind.foreign_into(), @@ -33,7 +33,7 @@ impl ForeignFrom for RoutingDictionaryRecord { fn foreign_from(value: RoutingAlgorithm) -> Self { Self { id: value.algorithm_id, - #[cfg(feature = "business_profile_routing")] + profile_id: value.profile_id, name: value.name, kind: value.kind.foreign_into(), @@ -52,7 +52,7 @@ impl ForeignTryFrom for MerchantRoutingAlgorithm { Ok(Self { id: value.algorithm_id, name: value.name, - #[cfg(feature = "business_profile_routing")] + profile_id: value.profile_id, description: value.description.unwrap_or_default(), algorithm: value diff --git a/crates/router/src/db/merchant_account.rs b/crates/router/src/db/merchant_account.rs index 39d63080a4b0..ff3830b23810 100644 --- a/crates/router/src/db/merchant_account.rs +++ b/crates/router/src/db/merchant_account.rs @@ -513,7 +513,6 @@ async fn publish_and_redact_merchant_account_cache( .as_ref() .map(|publishable_key| CacheKind::Accounts(publishable_key.into())); - #[cfg(feature = "business_profile_routing")] let cgraph_key = merchant_account.default_profile.as_ref().map(|profile_id| { CacheKind::CGraph( format!( @@ -525,11 +524,6 @@ async fn publish_and_redact_merchant_account_cache( ) }); - #[cfg(not(feature = "business_profile_routing"))] - let cgraph_key = Some(CacheKind::CGraph( - format!("cgraph_{}", merchant_account.merchant_id.clone()).into(), - )); - let mut cache_keys = vec![CacheKind::Accounts( merchant_account.merchant_id.as_str().into(), )]; diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index b8b329a3acb8..0d7d042f7af3 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -1,7 +1,7 @@ use std::{collections::HashMap, sync::Arc}; use actix_web::{web, Scope}; -#[cfg(all(feature = "business_profile_routing", feature = "olap"))] +#[cfg(feature = "olap")] use api_models::routing::RoutingRetrieveQuery; #[cfg(feature = "olap")] use common_enums::TransactionType; @@ -569,22 +569,19 @@ impl Routing { #[allow(unused_mut)] let mut route = web::scope("/routing") .app_data(web::Data::new(state.clone())) - .service(web::resource("/active").route(web::get().to( - |state, req, #[cfg(feature = "business_profile_routing")] query_params| { + .service( + web::resource("/active").route(web::get().to(|state, req, query_params| { cloud_routing::routing_retrieve_linked_config( state, req, - #[cfg(feature = "business_profile_routing")] query_params, - #[cfg(feature = "business_profile_routing")] &TransactionType::Payment, ) - }, - ))) + })), + ) .service( web::resource("") .route( - #[cfg(feature = "business_profile_routing")] web::get().to(|state, req, path: web::Query| { cloud_routing::list_routing_configs( state, @@ -593,8 +590,6 @@ impl Routing { &TransactionType::Payment, ) }), - #[cfg(not(feature = "business_profile_routing"))] - web::get().to(cloud_routing::list_routing_configs), ) .route(web::post().to(|state, req, payload| { cloud_routing::routing_create_config( @@ -623,17 +618,16 @@ impl Routing { ) })), ) - .service(web::resource("/deactivate").route(web::post().to( - |state, req, #[cfg(feature = "business_profile_routing")] payload| { + .service( + web::resource("/deactivate").route(web::post().to(|state, req, payload| { cloud_routing::routing_unlink_config( state, req, - #[cfg(feature = "business_profile_routing")] payload, &TransactionType::Payment, ) - }, - ))) + })), + ) .service( web::resource("/decision") .route(web::put().to(cloud_routing::upsert_decision_manager_config)) @@ -676,21 +670,16 @@ impl Routing { route = route .service( web::resource("/payouts") - .route( - #[cfg(feature = "business_profile_routing")] - web::get().to(|state, req, path: web::Query| { + .route(web::get().to( + |state, req, path: web::Query| { cloud_routing::list_routing_configs( state, req, - #[cfg(feature = "business_profile_routing")] path, - #[cfg(feature = "business_profile_routing")] &TransactionType::Payout, ) - }), - #[cfg(not(feature = "business_profile_routing"))] - web::get().to(cloud_routing::list_routing_configs), - ) + }, + )) .route(web::post().to(|state, req, payload| { cloud_routing::routing_create_config( state, @@ -701,13 +690,11 @@ impl Routing { })), ) .service(web::resource("/payouts/active").route(web::get().to( - |state, req, #[cfg(feature = "business_profile_routing")] query_params| { + |state, req, query_params| { cloud_routing::routing_retrieve_linked_config( state, req, - #[cfg(feature = "business_profile_routing")] query_params, - #[cfg(feature = "business_profile_routing")] &TransactionType::Payout, ) }, @@ -743,11 +730,10 @@ impl Routing { )), ) .service(web::resource("/payouts/deactivate").route(web::post().to( - |state, req, #[cfg(feature = "business_profile_routing")] payload| { + |state, req, payload| { cloud_routing::routing_unlink_config( state, req, - #[cfg(feature = "business_profile_routing")] payload, &TransactionType::Payout, ) diff --git a/crates/router/src/routes/routing.rs b/crates/router/src/routes/routing.rs index 74bd61765b0d..788acd4ba2da 100644 --- a/crates/router/src/routes/routing.rs +++ b/crates/router/src/routes/routing.rs @@ -3,9 +3,10 @@ //! Functions that are used to perform the api level configuration, retrieval, updation //! of Routing configs. use actix_web::{web, HttpRequest, Responder}; -#[cfg(feature = "business_profile_routing")] -use api_models::routing::{RoutingRetrieveLinkQuery, RoutingRetrieveQuery}; -use api_models::{enums, routing as routing_types}; +use api_models::{ + enums, routing as routing_types, + routing::{RoutingRetrieveLinkQuery, RoutingRetrieveQuery}, +}; use router_env::{ tracing::{self, instrument}, Flow, @@ -16,7 +17,6 @@ use crate::{ routes::AppState, services::{api as oss_api, authentication as auth, authorization::permissions::Permission}, }; - #[cfg(feature = "olap")] #[instrument(skip_all)] pub async fn routing_create_config( @@ -71,8 +71,6 @@ pub async fn routing_link_config( routing::link_routing_config( state, auth.merchant_account, - #[cfg(not(feature = "business_profile_routing"))] - auth.key_store, algorithm_id.0, transaction_type, ) @@ -125,61 +123,34 @@ pub async fn routing_retrieve_config( pub async fn list_routing_configs( state: web::Data, req: HttpRequest, - #[cfg(feature = "business_profile_routing")] query: web::Query, - #[cfg(feature = "business_profile_routing")] transaction_type: &enums::TransactionType, + query: web::Query, + transaction_type: &enums::TransactionType, ) -> impl Responder { - #[cfg(feature = "business_profile_routing")] - { - let flow = Flow::RoutingRetrieveDictionary; - Box::pin(oss_api::server_wrap( - flow, - state, - &req, - query.into_inner(), - |state, auth: auth::AuthenticationData, query_params, _| { - routing::retrieve_merchant_routing_dictionary( - state, - auth.merchant_account, - query_params, - transaction_type, - ) - }, - #[cfg(not(feature = "release"))] - auth::auth_type( - &auth::ApiKeyAuth, - &auth::JWTAuth(Permission::RoutingRead), - req.headers(), - ), - #[cfg(feature = "release")] - &auth::JWTAuth(Permission::RoutingRead), - api_locking::LockAction::NotApplicable, - )) - .await - } - - #[cfg(not(feature = "business_profile_routing"))] - { - let flow = Flow::RoutingRetrieveDictionary; - Box::pin(oss_api::server_wrap( - flow, - state, - &req, - (), - |state, auth: auth::AuthenticationData, _, _| { - routing::retrieve_merchant_routing_dictionary(state, auth.merchant_account) - }, - #[cfg(not(feature = "release"))] - auth::auth_type( - &auth::ApiKeyAuth, - &auth::JWTAuth(Permission::RoutingRead), - req.headers(), - ), - #[cfg(feature = "release")] + let flow = Flow::RoutingRetrieveDictionary; + Box::pin(oss_api::server_wrap( + flow, + state, + &req, + query.into_inner(), + |state, auth: auth::AuthenticationData, query_params, _| { + routing::retrieve_merchant_routing_dictionary( + state, + auth.merchant_account, + query_params, + transaction_type, + ) + }, + #[cfg(not(feature = "release"))] + auth::auth_type( + &auth::ApiKeyAuth, &auth::JWTAuth(Permission::RoutingRead), - api_locking::LockAction::NotApplicable, - )) - .await - } + req.headers(), + ), + #[cfg(feature = "release")] + &auth::JWTAuth(Permission::RoutingRead), + api_locking::LockAction::NotApplicable, + )) + .await } #[cfg(feature = "olap")] @@ -187,68 +158,34 @@ pub async fn list_routing_configs( pub async fn routing_unlink_config( state: web::Data, req: HttpRequest, - #[cfg(feature = "business_profile_routing")] payload: web::Json< - routing_types::RoutingConfigRequest, - >, + payload: web::Json, transaction_type: &enums::TransactionType, ) -> impl Responder { - #[cfg(feature = "business_profile_routing")] - { - let flow = Flow::RoutingUnlinkConfig; - Box::pin(oss_api::server_wrap( - flow, - state, - &req, - payload.into_inner(), - |state, auth: auth::AuthenticationData, payload_req, _| { - routing::unlink_routing_config( - state, - auth.merchant_account, - payload_req, - transaction_type, - ) - }, - #[cfg(not(feature = "release"))] - auth::auth_type( - &auth::ApiKeyAuth, - &auth::JWTAuth(Permission::RoutingWrite), - req.headers(), - ), - #[cfg(feature = "release")] - &auth::JWTAuth(Permission::RoutingWrite), - api_locking::LockAction::NotApplicable, - )) - .await - } - - #[cfg(not(feature = "business_profile_routing"))] - { - let flow = Flow::RoutingUnlinkConfig; - Box::pin(oss_api::server_wrap( - flow, - state, - &req, - (), - |state, auth: auth::AuthenticationData, _, _| { - routing::unlink_routing_config( - state, - auth.merchant_account, - auth.key_store, - transaction_type, - ) - }, - #[cfg(not(feature = "release"))] - auth::auth_type( - &auth::ApiKeyAuth, - &auth::JWTAuth(Permission::RoutingWrite), - req.headers(), - ), - #[cfg(feature = "release")] + let flow = Flow::RoutingUnlinkConfig; + Box::pin(oss_api::server_wrap( + flow, + state, + &req, + payload.into_inner(), + |state, auth: auth::AuthenticationData, payload_req, _| { + routing::unlink_routing_config( + state, + auth.merchant_account, + payload_req, + transaction_type, + ) + }, + #[cfg(not(feature = "release"))] + auth::auth_type( + &auth::ApiKeyAuth, &auth::JWTAuth(Permission::RoutingWrite), - api_locking::LockAction::NotApplicable, - )) - .await - } + req.headers(), + ), + #[cfg(feature = "release")] + &auth::JWTAuth(Permission::RoutingWrite), + api_locking::LockAction::NotApplicable, + )) + .await } #[cfg(feature = "olap")] @@ -508,62 +445,35 @@ pub async fn retrieve_decision_manager_config( pub async fn routing_retrieve_linked_config( state: web::Data, req: HttpRequest, - #[cfg(feature = "business_profile_routing")] query: web::Query, - #[cfg(feature = "business_profile_routing")] transaction_type: &enums::TransactionType, + query: web::Query, + transaction_type: &enums::TransactionType, ) -> impl Responder { - #[cfg(feature = "business_profile_routing")] - { - use crate::services::authentication::AuthenticationData; - let flow = Flow::RoutingRetrieveActiveConfig; - Box::pin(oss_api::server_wrap( - flow, - state, - &req, - query.into_inner(), - |state, auth: AuthenticationData, query_params, _| { - routing::retrieve_linked_routing_config( - state, - auth.merchant_account, - query_params, - transaction_type, - ) - }, - #[cfg(not(feature = "release"))] - auth::auth_type( - &auth::ApiKeyAuth, - &auth::JWTAuth(Permission::RoutingRead), - req.headers(), - ), - #[cfg(feature = "release")] - &auth::JWTAuth(Permission::RoutingRead), - api_locking::LockAction::NotApplicable, - )) - .await - } - - #[cfg(not(feature = "business_profile_routing"))] - { - let flow = Flow::RoutingRetrieveActiveConfig; - Box::pin(oss_api::server_wrap( - flow, - state, - &req, - (), - |state, auth: auth::AuthenticationData, _, _| { - routing::retrieve_linked_routing_config(state, auth.merchant_account) - }, - #[cfg(not(feature = "release"))] - auth::auth_type( - &auth::ApiKeyAuth, - &auth::JWTAuth(Permission::RoutingRead), - req.headers(), - ), - #[cfg(feature = "release")] + use crate::services::authentication::AuthenticationData; + let flow = Flow::RoutingRetrieveActiveConfig; + Box::pin(oss_api::server_wrap( + flow, + state, + &req, + query.into_inner(), + |state, auth: AuthenticationData, query_params, _| { + routing::retrieve_linked_routing_config( + state, + auth.merchant_account, + query_params, + transaction_type, + ) + }, + #[cfg(not(feature = "release"))] + auth::auth_type( + &auth::ApiKeyAuth, &auth::JWTAuth(Permission::RoutingRead), - api_locking::LockAction::NotApplicable, - )) - .await - } + req.headers(), + ), + #[cfg(feature = "release")] + &auth::JWTAuth(Permission::RoutingRead), + api_locking::LockAction::NotApplicable, + )) + .await } #[cfg(feature = "olap")] diff --git a/crates/router/src/types/api/routing.rs b/crates/router/src/types/api/routing.rs index 4f982d543df2..d201f57eb924 100644 --- a/crates/router/src/types/api/routing.rs +++ b/crates/router/src/types/api/routing.rs @@ -1,11 +1,9 @@ -#[cfg(feature = "backwards_compatibility")] -pub use api_models::routing::RoutableChoiceKind; pub use api_models::{ enums as api_enums, routing::{ - ConnectorVolumeSplit, RoutableConnectorChoice, RoutingAlgorithm, RoutingAlgorithmKind, - RoutingAlgorithmRef, RoutingConfigRequest, RoutingDictionary, RoutingDictionaryRecord, - StraightThroughAlgorithm, + ConnectorVolumeSplit, RoutableChoiceKind, RoutableConnectorChoice, RoutingAlgorithm, + RoutingAlgorithmKind, RoutingAlgorithmRef, RoutingConfigRequest, RoutingDictionary, + RoutingDictionaryRecord, StraightThroughAlgorithm, }, }; @@ -13,8 +11,6 @@ use super::types::api as api_oss; pub struct SessionRoutingChoice { pub connector: api_oss::ConnectorData, - #[cfg(not(feature = "connector_choice_mca_id"))] - pub sub_label: Option, pub payment_method_type: api_enums::PaymentMethodType, } diff --git a/crates/router/src/types/storage.rs b/crates/router/src/types/storage.rs index 7713d88cb429..b12457984446 100644 --- a/crates/router/src/types/storage.rs +++ b/crates/router/src/types/storage.rs @@ -71,10 +71,9 @@ use crate::types::api::routing; #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct RoutingData { pub routed_through: Option, - #[cfg(feature = "connector_choice_mca_id")] + pub merchant_connector_id: Option, - #[cfg(not(feature = "connector_choice_mca_id"))] - pub business_sub_label: Option, + pub routing_info: PaymentRoutingInfo, pub algorithm: Option, } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario22-Create Gift Card payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario22-Create Gift Card payment/Payments - Create/request.json index 0915e9894bb6..f8e5000d3144 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario22-Create Gift Card payment/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario22-Create Gift Card payment/Payments - Create/request.json @@ -42,10 +42,6 @@ } } }, - "routing": { - "type": "single", - "data": "adyen" - }, "billing": { "address": { "line1": "1467", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/request.json index ed9dbeaa9c49..8ac3ed14b0a7 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/request.json @@ -43,10 +43,6 @@ "card_cvc": "7373" } }, - "routing": { - "type": "single", - "data": "adyen" - }, "billing": { "address": { "line1": "1467", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario10-Create Gift Card payment where it fails due to insufficient balance/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario10-Create Gift Card payment where it fails due to insufficient balance/Payments - Create/request.json index 11437ff57659..923cb4aae78b 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario10-Create Gift Card payment where it fails due to insufficient balance/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario10-Create Gift Card payment where it fails due to insufficient balance/Payments - Create/request.json @@ -42,10 +42,6 @@ } } }, - "routing": { - "type": "single", - "data": "adyen" - }, "billing": { "address": { "line1": "1467", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario4-Create failed payment with confirm true copy/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario4-Create failed payment with confirm true copy/Payments - Create/request.json index b9bf4f2b66ea..f477cdecc3f8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario4-Create failed payment with confirm true copy/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario4-Create failed payment with confirm true copy/Payments - Create/request.json @@ -16,10 +16,6 @@ "amount": 7003, "currency": "USD", "confirm": true, - "routing": { - "data": "authorizedotnet", - "type": "single" - }, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "StripeCustomer", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario12-Failed case for wrong api keys/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario12-Failed case for wrong api keys/Payments - Create/request.json index b9bf4f2b66ea..f477cdecc3f8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario12-Failed case for wrong api keys/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario12-Failed case for wrong api keys/Payments - Create/request.json @@ -16,10 +16,6 @@ "amount": 7003, "currency": "USD", "confirm": true, - "routing": { - "data": "authorizedotnet", - "type": "single" - }, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "StripeCustomer", diff --git a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 43eb0c9cc123..cc19ac2bab29 100644 --- a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -86,10 +86,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index c2a8a615d1c2..14f671d7f6fd 100644 --- a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -78,10 +78,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index 71cc91069581..66f5c825b122 100644 --- a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -64,10 +64,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "bankofamerica" } } }, diff --git a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 8bd119ed2fea..5ec6335d05ab 100644 --- a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -86,10 +86,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 8ea0f5f20392..b2c86ceb5e70 100644 --- a/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -86,10 +86,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/bankofamerica/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/bankofamerica/Flow Testcases/QuickStart/Payments - Create/request.json index 580e722c1d5d..2685dca3f068 100644 --- a/postman/collection-dir/bankofamerica/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/bankofamerica/Flow Testcases/QuickStart/Payments - Create/request.json @@ -83,10 +83,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "bankofamerica" } } }, diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario28-Create partially captured payment with refund/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario28-Create partially captured payment with refund/Payments - Create/request.json index 4cbb79aa56af..b4169de20837 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario28-Create partially captured payment with refund/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario28-Create partially captured payment with refund/Payments - Create/request.json @@ -74,10 +74,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json index 197580ddffa4..74441099ea1b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json @@ -71,10 +71,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "checkout" } } }, diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json index b28dec99902e..04df55714a78 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json @@ -71,10 +71,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "checkout" } } }, diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json index b28dec99902e..04df55714a78 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json @@ -71,10 +71,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "checkout" } } }, diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json index b28dec99902e..04df55714a78 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json @@ -71,10 +71,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "checkout" } } }, diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json index b28dec99902e..04df55714a78 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json @@ -71,10 +71,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "checkout" } } }, diff --git a/postman/collection-dir/cybersource/Flow Testcases/Happy Cases/Scenario9-Add card flow/Save card payments - Create/request.json b/postman/collection-dir/cybersource/Flow Testcases/Happy Cases/Scenario9-Add card flow/Save card payments - Create/request.json index 4afeccc8246d..f40a645ea0fc 100644 --- a/postman/collection-dir/cybersource/Flow Testcases/Happy Cases/Scenario9-Add card flow/Save card payments - Create/request.json +++ b/postman/collection-dir/cybersource/Flow Testcases/Happy Cases/Scenario9-Add card flow/Save card payments - Create/request.json @@ -66,10 +66,6 @@ "country_code": "+91" } }, - "routing": { - "type": "single", - "data": "stripe" - }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario7-Create payment with Zero Amount/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario7-Create payment with Zero Amount/Payments - Create/request.json index 0bf23604d848..624968c77cd9 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario7-Create payment with Zero Amount/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario7-Create payment with Zero Amount/Payments - Create/request.json @@ -30,10 +30,6 @@ "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", - "routing": { - "type": "single", - "data": "forte" - }, "return_url": "https://duck.com", "payment_method": "card", "payment_method_data": { diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/request.json index 04be684704b6..05fde18c2d97 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/request.json @@ -21,10 +21,6 @@ "amount": 6540, "currency": "USD", "confirm": true, - "routing": { - "type": "single", - "data": "forte" - }, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json index 64df182d1e7b..d1361c52bc75 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json @@ -21,10 +21,6 @@ "amount": 8000, "currency": "USD", "confirm": false, - "routing": { - "type": "single", - "data": "stripe" - }, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/request.json index a4e816ad17d2..289e780a72cb 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/request.json @@ -55,10 +55,6 @@ "last_name": "happy" } }, - "routing": { - "type": "single", - "data": "multisafepay" - }, "shipping": { "address": { "line1": "1467", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario6- Create payment with Invalid Merchant ID/Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario6- Create payment with Invalid Merchant ID/Payments - Create/request.json index 525eaa739e83..289e780a72cb 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario6- Create payment with Invalid Merchant ID/Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario6- Create payment with Invalid Merchant ID/Payments - Create/request.json @@ -42,10 +42,6 @@ "card_cvc": "123" } }, - "routing": { - "type": "single", - "data": "multisafepay" - }, "billing": { "address": { "line1": "1467", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario13-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario13-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json index 050f353af538..e04dc7b4280f 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario13-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario13-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json @@ -86,10 +86,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 07a9e0fc0b95..db81c387d5a7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/request.json index 2cbfe4a20f1e..314752373cc8 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/request.json @@ -97,10 +97,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Create/request.json index 9e084a35c8c9..691f63896f6a 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Create/request.json @@ -65,10 +65,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "paypal" } } }, diff --git a/postman/collection-dir/prophetpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/prophetpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 2c8566c24282..58e786c79dbf 100644 --- a/postman/collection-dir/prophetpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/prophetpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -28,13 +28,9 @@ "payment_method": "card_redirect", "payment_method_type": "card_redirect", "payment_method_data": { - "card_redirect": { - "card_redirect": {} - } - }, - "routing": { - "type": "single", - "data": "prophetpay" + "card_redirect": { + "card_redirect": {} + } } } }, diff --git a/postman/collection-dir/prophetpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/prophetpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 851a18115f97..514099b88a1a 100644 --- a/postman/collection-dir/prophetpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/prophetpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -24,11 +24,7 @@ "amount_to_capture": 8000, "business_country": "US", "customer_id": "not_a_rick_roll", - "return_url": "https://www.google.com", - "routing": { - "type": "single", - "data": "prophetpay" - } + "return_url": "https://www.google.com" } }, "url": { diff --git a/postman/collection-dir/prophetpay/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/prophetpay/Flow Testcases/QuickStart/Payments - Create/request.json index 11c9749e9589..5302bca0e280 100644 --- a/postman/collection-dir/prophetpay/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/prophetpay/Flow Testcases/QuickStart/Payments - Create/request.json @@ -28,13 +28,9 @@ "payment_method": "card_redirect", "payment_method_type": "card_redirect", "payment_method_data": { - "card_redirect": { - "card_redirect": {} - } - }, - "routing": { - "type": "single", - "data": "prophetpay" + "card_redirect": { + "card_redirect": {} + } } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 950ec531ae7c..48b7d410897f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -98,10 +98,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json index b5ef6b1afe21..b32011d26dc8 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json @@ -97,10 +97,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/request.json index 613e9148f787..f6038bfc21bf 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/request.json @@ -52,10 +52,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json index 61f007ede682..18f12b7306d4 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json @@ -85,10 +85,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json index fe8a73d4581a..8ca8a333ad34 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json @@ -52,10 +52,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json index f621bd52f00d..88e6597536af 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json @@ -38,10 +38,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json index d108e1198a7d..2e536713b9fb 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json @@ -78,10 +78,6 @@ "amount": 7000, "quantity": 1 } - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json index eedc71f3a1aa..3675475c0837 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json @@ -77,10 +77,6 @@ "amount": 7000, "quantity": 1 } - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json index 048893f35111..247f1256f7ab 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json @@ -76,10 +76,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json index 21e71ad037a9..0b0c56d26601 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json @@ -76,10 +76,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json index 026af8449ce8..f423db211509 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json @@ -76,10 +76,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Transfer-ach/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Transfer-ach/Payments - Create/request.json index 7fa60b50cda7..b9e58c09ce9a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Transfer-ach/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Transfer-ach/Payments - Create/request.json @@ -52,10 +52,6 @@ "last_name": "Kumari" }, "email": "guest@example.com" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/request.json index 53fe9371e492..473970b21c61 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/request.json @@ -95,10 +95,6 @@ "amount": 1800, "account_name": "transaction_processing" } - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario20-Wallet-Wechatpay/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario20-Wallet-Wechatpay/Payments - Create/request.json index daffd2ab9ec1..2b623eed2ed7 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario20-Wallet-Wechatpay/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario20-Wallet-Wechatpay/Payments - Create/request.json @@ -40,10 +40,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario21- Update address and List Payment method/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario21- Update address and List Payment method/Payments - Create/request.json index beeb5b3983f5..2f7bdae8a6af 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario21- Update address and List Payment method/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario21- Update address and List Payment method/Payments - Create/request.json @@ -62,10 +62,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22- Update Amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22- Update Amount/Payments - Create/request.json index 785122a83c50..b41aa02e5d0a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22- Update Amount/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22- Update Amount/Payments - Create/request.json @@ -62,10 +62,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Payments - Create/request.json index 9d931d385303..4f64a5d0e343 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Payments - Create/request.json @@ -86,10 +86,6 @@ "country_code": "+91" } }, - "routing": { - "type": "single", - "data": "stripe" - }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Save card payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Save card payments - Create/request.json index 4afeccc8246d..3371960e6720 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Save card payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Save card payments - Create/request.json @@ -66,10 +66,6 @@ "country_code": "+91" } }, - "routing": { - "type": "single", - "data": "stripe" - }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { @@ -81,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments" - ] + "host": ["{{baseUrl}}"], + "path": ["payments"] }, "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario24-Don't Pass CVV for save card flow and verifysuccess payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario24-Don't Pass CVV for save card flow and verifysuccess payment/Payments - Create/request.json index b903a3ca741b..b0ff74e8884f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario24-Don't Pass CVV for save card flow and verifysuccess payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario24-Don't Pass CVV for save card flow and verifysuccess payment/Payments - Create/request.json @@ -92,10 +92,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario24-Don't Pass CVV for save card flow and verifysuccess payment/Save card payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario24-Don't Pass CVV for save card flow and verifysuccess payment/Save card payments - Create/request.json index a3ca3aa6ac9c..f40a645ea0fc 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario24-Don't Pass CVV for save card flow and verifysuccess payment/Save card payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario24-Don't Pass CVV for save card flow and verifysuccess payment/Save card payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Save card payment with manual capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Save card payment with manual capture/Payments - Create/request.json index 9b1092f93fc3..7b15b0ee8714 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Save card payment with manual capture/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Save card payment with manual capture/Payments - Create/request.json @@ -92,10 +92,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Save card payment with manual capture/Save card payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Save card payment with manual capture/Save card payments - Create/request.json index dc78d553ec53..0e614b315f9e 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Save card payment with manual capture/Save card payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Save card payment with manual capture/Save card payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json index 6a9836d232cc..627c816fba92 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json @@ -86,10 +86,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Confirm a payment with requires_customer_action status/Payments - Create with confirm true/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Confirm a payment with requires_customer_action status/Payments - Create with confirm true/request.json index 7e28058ccf62..2fc1d3e06265 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Confirm a payment with requires_customer_action status/Payments - Create with confirm true/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Confirm a payment with requires_customer_action status/Payments - Create with confirm true/request.json @@ -83,10 +83,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Create payment with payment method billing/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Create payment with payment method billing/Payments - Create/request.json index 83e3a58da2e0..578d3c472672 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Create payment with payment method billing/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Create payment with payment method billing/Payments - Create/request.json @@ -79,10 +79,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Update payment with payment method billing/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Update payment with payment method billing/Payments - Create/request.json index 95c2541e0bca..14381e2d55a9 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Update payment with payment method billing/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Update payment with payment method billing/Payments - Create/request.json @@ -54,10 +54,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index beeb5b3983f5..2f7bdae8a6af 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -62,10 +62,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 0619498e38c7..4deef11deb58 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json index 0fbd6a4dcdd5..f1ff4cb5692e 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 0619498e38c7..4deef11deb58 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index 7e28058ccf62..2fc1d3e06265 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -83,10 +83,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.json index 14f3394596fd..72c0cf1fd9b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario8-Create a failure card payment with confirm true/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario8-Create a failure card payment with confirm true/Payments - Create/request.json index a3e0f52b8d77..1a9dc985891c 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario8-Create a failure card payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario8-Create a failure card payment with confirm true/Payments - Create/request.json @@ -86,10 +86,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 2363c62ff27f..f58c425653ca 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json index b5f464abc14b..f58c425653ca 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json @@ -72,21 +72,13 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments" - ] + "host": ["{{baseUrl}}"], + "path": ["payments"] }, "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture" } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json index 0a7b19679aa6..2225c6096e37 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 0e1f282acdb9..02e431466aa2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 92e81f4f53ae..52c73bea7433 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index a8f4cf69a292..c7ad4cb2749f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -70,10 +70,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index fdc09ce202f9..9fa8e3bbe129 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json index 90b6e3bd0385..d6f53f92a041 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json @@ -71,10 +71,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index beeb5b3983f5..2f7bdae8a6af 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -62,10 +62,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 0619498e38c7..4deef11deb58 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 2363c62ff27f..f58c425653ca 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 2363c62ff27f..f58c425653ca 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index c132368eb406..9c2ddbffb6d7 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index 2363c62ff27f..f58c425653ca 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 4105bd1a869b..3e1f1231ff86 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -72,10 +72,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json index b5ef6b1afe21..b32011d26dc8 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -97,10 +97,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index 3ced4fa53275..299eb1685b71 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -64,10 +64,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json index 3b16fb5e6598..93bda6402292 100644 --- a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json +++ b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json @@ -92,10 +92,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json b/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json index bef68a26086d..c985bf50b0de 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json @@ -83,10 +83,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json index 544af8234f60..2b6d4bf3338d 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json @@ -83,10 +83,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/Payments/Payments - Create/request.json b/postman/collection-dir/stripe/Payments/Payments - Create/request.json index 55ddd525d4a6..5a7457cedf96 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Create/request.json @@ -83,10 +83,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json index 34d455fe769e..5fcc5647594d 100644 --- a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json +++ b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json @@ -86,7 +86,10 @@ }, "routing": { "type": "single", - "data": "stripe" + "data": { + "connector":"stripe", + "merchant_connector_id":"{{merchant_connector_id}}" + } } } }, diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json b/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json index cbf58f2e89ae..13ed1a212de4 100644 --- a/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json @@ -87,7 +87,10 @@ }, "routing": { "type": "single", - "data": "stripe" + "data": { + "connector":"stripe", + "merchant_connector_id":"{{merchant_connector_id}}" + } } } }, diff --git a/postman/collection-dir/stripe/Refunds/Payments - Create/request.json b/postman/collection-dir/stripe/Refunds/Payments - Create/request.json index 24a37d16cf54..d3219a30cf88 100644 --- a/postman/collection-dir/stripe/Refunds/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Refunds/Payments - Create/request.json @@ -84,10 +84,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "stripe" } } }, diff --git a/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index bd076535780a..6cf802f630c0 100644 --- a/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -82,10 +82,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "volt" } } }, diff --git a/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 744663ee79e1..b5bbc7aca19f 100644 --- a/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -82,10 +82,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "volt" } } }, diff --git a/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index 7323f440e645..bde98e7ef082 100644 --- a/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -63,10 +63,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "volt" } } }, diff --git a/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario4-Bank Redirect-open_banking_uk/Payments - Create/request.json b/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario4-Bank Redirect-open_banking_uk/Payments - Create/request.json index 7323f440e645..bde98e7ef082 100644 --- a/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario4-Bank Redirect-open_banking_uk/Payments - Create/request.json +++ b/postman/collection-dir/volt/Flow Testcases/Happy Cases/Scenario4-Bank Redirect-open_banking_uk/Payments - Create/request.json @@ -63,10 +63,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "volt" } } }, diff --git a/postman/collection-dir/volt/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/volt/Flow Testcases/QuickStart/Payments - Create/request.json index bd076535780a..6cf802f630c0 100644 --- a/postman/collection-dir/volt/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/volt/Flow Testcases/QuickStart/Payments - Create/request.json @@ -82,10 +82,6 @@ "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" - }, - "routing": { - "type": "single", - "data": "volt" } } },