From 3031a675c685621c6338be568412a040e8935b94 Mon Sep 17 00:00:00 2001 From: hrithikesh026 Date: Mon, 9 Sep 2024 16:56:12 +0530 Subject: [PATCH] chore: remove Connectors enum dependency from ConnectorIntegrationV2 trait --- .../hyperswitch_interfaces/src/connector_integration_v2.rs | 7 +------ .../router/src/services/connector_integration_interface.rs | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/hyperswitch_interfaces/src/connector_integration_v2.rs b/crates/hyperswitch_interfaces/src/connector_integration_v2.rs index d03dee5f7f33..90c3f950a4e2 100644 --- a/crates/hyperswitch_interfaces/src/connector_integration_v2.rs +++ b/crates/hyperswitch_interfaces/src/connector_integration_v2.rs @@ -9,8 +9,7 @@ use router_env::metrics::add_attributes; use serde_json::json; use crate::{ - api::CaptureSyncMethod, configs::Connectors, errors, - events::connector_api_logs::ConnectorEvent, metrics, types, + api::CaptureSyncMethod, errors, events::connector_api_logs::ConnectorEvent, metrics, types, }; /// alias for Box of a type that implements trait ConnectorIntegrationV2 @@ -47,7 +46,6 @@ pub trait ConnectorIntegrationV2: fn get_headers( &self, _req: &RouterDataV2, - _connectors: &Connectors, ) -> CustomResult)>, errors::ConnectorError> { Ok(vec![]) } @@ -66,7 +64,6 @@ pub trait ConnectorIntegrationV2: fn get_url( &self, _req: &RouterDataV2, - _connectors: &Connectors, ) -> CustomResult { Ok(String::new()) } @@ -75,7 +72,6 @@ pub trait ConnectorIntegrationV2: fn get_request_body( &self, _req: &RouterDataV2, - _connectors: &Connectors, ) -> CustomResult { Ok(RequestContent::Json(Box::new(json!(r#"{}"#)))) } @@ -92,7 +88,6 @@ pub trait ConnectorIntegrationV2: fn build_request_v2( &self, _req: &RouterDataV2, - _connectors: &Connectors, ) -> CustomResult, errors::ConnectorError> { metrics::UNIMPLEMENTED_FLOW.add( &metrics::CONTEXT, diff --git a/crates/router/src/services/connector_integration_interface.rs b/crates/router/src/services/connector_integration_interface.rs index 8da81a52f9fd..6b22d5ebf4d9 100644 --- a/crates/router/src/services/connector_integration_interface.rs +++ b/crates/router/src/services/connector_integration_interface.rs @@ -570,7 +570,7 @@ where } ConnectorIntegrationEnum::New(new_integration) => { let new_router_data = ResourceCommonData::from_old_router_data(req)?; - new_integration.build_request_v2(&new_router_data, connectors) + new_integration.build_request_v2(&new_router_data) } } }