Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

chore: remove Connectors enum dependency from ConnectorIntegrationV2 trait (#5840)

Hrithikesh296ca311c96c
diff --git a/crates/hyperswitch_interfaces/src/connector_integration_v2.rs b/crates/hyperswitch_interfaces/src/connector_integration_v2.rs
index d03dee5f7f..90c3f950a4 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<Flow, ResourceCommonData, Req, Resp>:
fn get_headers(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
- _connectors: &Connectors,
) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> {
Ok(vec![])
}
@@ -66,7 +64,6 @@ pub trait ConnectorIntegrationV2<Flow, ResourceCommonData, Req, Resp>:
fn get_url(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
- _connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(String::new())
}
@@ -75,7 +72,6 @@ pub trait ConnectorIntegrationV2<Flow, ResourceCommonData, Req, Resp>:
fn get_request_body(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
- _connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
Ok(RequestContent::Json(Box::new(json!(r#"{}"#))))
}
@@ -92,7 +88,6 @@ pub trait ConnectorIntegrationV2<Flow, ResourceCommonData, Req, Resp>:
fn build_request_v2(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
- _connectors: &Connectors,
) -> CustomResult<Option<Request>, 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 8da81a52f9..6b22d5ebf4 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)
}
}
}