Bug: refactor(NMI,PAYONE) , Move files from router to hyperswitch connectors



Move the connectors from routers to hyperswitch_connectors
diff --git a/Cargo.lock b/Cargo.lock
index ea92a99a2c3..068bb1cecb7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3870,6 +3870,7 @@ dependencies = [
  "serde",
  "serde_json",
  "serde_qs",
+ "serde_repr",
  "serde_urlencoded",
  "serde_with",
  "sha1",
@@ -6535,7 +6536,6 @@ dependencies = [
  "serde_json",
  "serde_path_to_error",
  "serde_qs",
- "serde_repr",
  "serde_urlencoded",
  "serde_with",
  "serial_test",
diff --git a/crates/hyperswitch_connectors/Cargo.toml b/crates/hyperswitch_connectors/Cargo.toml
index 0d981bf35ba..b8b74ae272a 100644
--- a/crates/hyperswitch_connectors/Cargo.toml
+++ b/crates/hyperswitch_connectors/Cargo.toml
@@ -36,6 +36,7 @@ roxmltree = "0.19.0"
 serde = { version = "1.0.197", features = ["derive"] }
 serde_json = "1.0.115"
 serde_qs = "0.12.0"
+serde_repr = "0.1.19"
 serde_urlencoded = "0.7.1"
 serde_with = "3.7.0"
 sha1 = { version = "0.10.6" }
diff --git a/crates/hyperswitch_connectors/src/connectors.rs b/crates/hyperswitch_connectors/src/connectors.rs
index 93db897bfaf..80e1253940b 100644
--- a/crates/hyperswitch_connectors/src/connectors.rs
+++ b/crates/hyperswitch_connectors/src/connectors.rs
@@ -47,6 +47,7 @@ pub mod moneris;
 pub mod multisafepay;
 pub mod nexinets;
 pub mod nexixpay;
+pub mod nmi;
 pub mod nomupay;
 pub mod noon;
 pub mod novalnet;
@@ -56,6 +57,7 @@ pub mod opennode;
 pub mod paybox;
 pub mod payeezy;
 pub mod payme;
+pub mod payone;
 pub mod paypal;
 pub mod paystack;
 pub mod payu;
@@ -66,6 +68,7 @@ pub mod rapyd;
 pub mod razorpay;
 pub mod recurly;
 pub mod redsys;
+pub mod riskified;
 pub mod shift4;
 pub mod square;
 pub mod stax;
@@ -82,7 +85,6 @@ pub mod worldpay;
 pub mod xendit;
 pub mod zen;
 pub mod zsl;
-
 pub use self::{
     aci::Aci, adyen::Adyen, airwallex::Airwallex, amazonpay::Amazonpay,
     authorizedotnet::Authorizedotnet, bambora::Bambora, bamboraapac::Bamboraapac,
@@ -96,13 +98,13 @@ pub use self::{
     helcim::Helcim, hipay::Hipay, iatapay::Iatapay, inespay::Inespay, itaubank::Itaubank,
     jpmorgan::Jpmorgan, juspaythreedsserver::Juspaythreedsserver, klarna::Klarna,
     mifinity::Mifinity, mollie::Mollie, moneris::Moneris, multisafepay::Multisafepay,
-    nexinets::Nexinets, nexixpay::Nexixpay, nomupay::Nomupay, noon::Noon, novalnet::Novalnet,
-    nuvei::Nuvei, opayo::Opayo, opennode::Opennode, paybox::Paybox, payeezy::Payeezy, payme::Payme,
-    paypal::Paypal, paystack::Paystack, payu::Payu, placetopay::Placetopay, powertranz::Powertranz,
-    prophetpay::Prophetpay, rapyd::Rapyd, razorpay::Razorpay, recurly::Recurly, redsys::Redsys,
-    shift4::Shift4, square::Square, stax::Stax, stripebilling::Stripebilling, taxjar::Taxjar,
-    thunes::Thunes, trustpay::Trustpay, tsys::Tsys,
-    unified_authentication_service::UnifiedAuthenticationService, volt::Volt,
-    wellsfargo::Wellsfargo, worldline::Worldline, worldpay::Worldpay, xendit::Xendit, zen::Zen,
-    zsl::Zsl,
+    nexinets::Nexinets, nexixpay::Nexixpay, nmi::Nmi, nomupay::Nomupay, noon::Noon,
+    novalnet::Novalnet, nuvei::Nuvei, opayo::Opayo, opennode::Opennode, paybox::Paybox,
+    payeezy::Payeezy, payme::Payme, payone::Payone, paypal::Paypal, paystack::Paystack, payu::Payu,
+    placetopay::Placetopay, powertranz::Powertranz, prophetpay::Prophetpay, rapyd::Rapyd,
+    razorpay::Razorpay, recurly::Recurly, redsys::Redsys, riskified::Riskified, shift4::Shift4,
+    square::Square, stax::Stax, stripebilling::Stripebilling, taxjar::Taxjar, thunes::Thunes,
+    trustpay::Trustpay, tsys::Tsys, unified_authentication_service::UnifiedAuthenticationService,
+    volt::Volt, wellsfargo::Wellsfargo, worldline::Worldline, worldpay::Worldpay, xendit::Xendit,
+    zen::Zen, zsl::Zsl,
 };
diff --git a/crates/router/src/connector/nmi.rs b/crates/hyperswitch_connectors/src/connectors/nmi.rs
similarity index 51%
rename from crates/router/src/connector/nmi.rs
rename to crates/hyperswitch_connectors/src/connectors/nmi.rs
index 575f4b136eb..b2037c45256 100644
--- a/crates/router/src/connector/nmi.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nmi.rs
@@ -1,31 +1,54 @@
 pub mod transformers;
-
+use api_models::webhooks::IncomingWebhookEvent;
+use common_enums::{enums, CallConnectorAction, PaymentAction};
 use common_utils::{
     crypto,
+    errors::CustomResult,
     ext_traits::ByteSliceExt,
-    request::RequestContent,
+    request::{Method, Request, RequestBuilder, RequestContent},
     types::{AmountConvertor, FloatMajorUnit, FloatMajorUnitForConnector},
 };
-use diesel_models::enums;
 use error_stack::{report, ResultExt};
-use regex::Regex;
-use transformers as nmi;
-
-use super::utils as connector_utils;
-use crate::{
-    configs::settings,
-    core::{
-        errors::{self, CustomResult},
-        payments,
+use hyperswitch_domain_models::{
+    router_data::{AccessToken, ErrorResponse, RouterData},
+    router_flow_types::{
+        AccessTokenAuth, Authorize, Capture, CompleteAuthorize, Execute, PSync, PaymentMethodToken,
+        PreProcessing, RSync, Session, SetupMandate, Void,
+    },
+    router_request_types::{
+        AccessTokenRequestData, CompleteAuthorizeData, PaymentMethodTokenizationData,
+        PaymentsAuthorizeData, PaymentsCancelData, PaymentsCaptureData, PaymentsPreProcessingData,
+        PaymentsSessionData, PaymentsSyncData, RefundsData, SetupMandateRequestData,
     },
+    router_response_types::{PaymentsResponseData, RefundsResponseData},
+    types::{
+        PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
+        PaymentsCompleteAuthorizeRouterData, PaymentsPreProcessingRouterData,
+        PaymentsSyncRouterData, RefundsRouterData, SetupMandateRouterData,
+    },
+};
+use hyperswitch_interfaces::{
+    api::{
+        self, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorRedirectResponse,
+        ConnectorSpecifications, ConnectorValidation,
+    },
+    configs::Connectors,
+    errors::ConnectorError,
     events::connector_api_logs::ConnectorEvent,
-    services::{self, request, ConnectorIntegration, ConnectorSpecifications, ConnectorValidation},
     types::{
-        self,
-        api::{self, ConnectorCommon, ConnectorCommonExt},
-        transformers::ForeignFrom,
-        ErrorResponse,
+        PaymentsAuthorizeType, PaymentsCaptureType, PaymentsCompleteAuthorizeType,
+        PaymentsPreProcessingType, PaymentsSyncType, PaymentsVoidType, RefundExecuteType,
+        RefundSyncType, Response,
     },
+    webhooks::{IncomingWebhook, IncomingWebhookRequestDetails},
+};
+use masking::Maskable;
+use regex::Regex;
+use transformers as nmi;
+
+use crate::{
+    types::ResponseRouterData,
+    utils::{construct_not_supported_error_report, convert_amount, get_header_key_value},
 };
 
 #[derive(Clone)]
@@ -60,9 +83,9 @@ where
 {
     fn build_headers(
         &self,
-        _req: &types::RouterData<Flow, Request, Response>,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        _req: &RouterData<Flow, Request, Response>,
+        _connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         Ok(vec![(
             "Content-Type".to_string(),
             "application/x-www-form-urlencoded".to_string().into(),
@@ -79,19 +102,19 @@ impl ConnectorCommon for Nmi {
         api::CurrencyUnit::Base
     }
 
-    fn base_url<'a>(&self, connectors: &'a settings::Connectors) -> &'a str {
+    fn base_url<'a>(&self, connectors: &'a Connectors) -> &'a str {
         connectors.nmi.base_url.as_ref()
     }
 
     fn build_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         let response: nmi::StandardResponse = res
             .response
             .parse_struct("StandardResponse")
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
 
         event_builder.map(|i| i.set_error_response_body(&response));
         router_env::logger::info!(connector_response=?response);
@@ -116,94 +139,78 @@ impl ConnectorValidation for Nmi {
         capture_method: Option<enums::CaptureMethod>,
         _payment_method: enums::PaymentMethod,
         _pmt: Option<enums::PaymentMethodType>,
-    ) -> CustomResult<(), errors::ConnectorError> {
+    ) -> CustomResult<(), ConnectorError> {
         let capture_method = capture_method.unwrap_or_default();
         match capture_method {
             enums::CaptureMethod::Automatic
             | enums::CaptureMethod::Manual
             | enums::CaptureMethod::SequentialAutomatic => Ok(()),
             enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err(
-                connector_utils::construct_not_supported_error_report(capture_method, self.id()),
+                construct_not_supported_error_report(capture_method, self.id()),
             ),
         }
     }
 
     fn validate_psync_reference_id(
         &self,
-        _data: &hyperswitch_domain_models::router_request_types::PaymentsSyncData,
+        _data: &PaymentsSyncData,
         _is_three_ds: bool,
         _status: enums::AttemptStatus,
         _connector_meta_data: Option<common_utils::pii::SecretSerdeValue>,
-    ) -> CustomResult<(), errors::ConnectorError> {
+    ) -> CustomResult<(), ConnectorError> {
         // in case we dont have transaction id, we can make psync using attempt id
         Ok(())
     }
 }
 
-impl
-    ConnectorIntegration<
-        api::PaymentMethodToken,
-        types::PaymentMethodTokenizationData,
-        types::PaymentsResponseData,
-    > for Nmi
-{
-}
-
-impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData>
+impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
     for Nmi
 {
 }
 
-impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken>
-    for Nmi
-{
-}
+impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Nmi {}
 
-impl
-    ConnectorIntegration<
-        api::SetupMandate,
-        types::SetupMandateRequestData,
-        types::PaymentsResponseData,
-    > for Nmi
-{
+impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Nmi {}
+
+impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Nmi {
     fn get_headers(
         &self,
-        req: &types::SetupMandateRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &SetupMandateRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
     fn get_url(
         &self,
-        _req: &types::SetupMandateRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &SetupMandateRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}api/transact.php", self.base_url(connectors)))
     }
 
     fn get_request_body(
         &self,
-        req: &types::SetupMandateRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        req: &SetupMandateRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
         let connector_req = nmi::NmiPaymentsRequest::try_from(req)?;
         Ok(RequestContent::FormUrlEncoded(Box::new(connector_req)))
     }
 
     fn build_request(
         &self,
-        _req: &types::SetupMandateRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
-        Err(errors::ConnectorError::NotImplemented("Setup Mandate flow for Nmi".to_string()).into())
+        _req: &SetupMandateRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
+        Err(ConnectorError::NotImplemented("Setup Mandate flow for Nmi".to_string()).into())
 
         // Ok(Some(
-        //     services::RequestBuilder::new()
-        //         .method(services::Method::Post)
-        //         .url(&types::SetupMandateType::get_url(self, req, connectors)?)
-        //         .headers(types::SetupMandateType::get_headers(self, req, connectors)?)
-        //         .set_body(types::SetupMandateType::get_request_body(
+        //     RequestBuilder::new()
+        //         .method(Method::Post)
+        //         .url(&SetupMandateType::get_url(self, req, connectors)?)
+        //         .headers(SetupMandateType::get_headers(self, req, connectors)?)
+        //         .set_body(SetupMandateType::get_request_body(
         //             self, req, connectors,
         //         )?)
         //         .build(),
@@ -212,15 +219,15 @@ impl
 
     fn handle_response(
         &self,
-        data: &types::SetupMandateRouterData,
+        data: &SetupMandateRouterData,
         event_builder: Option<&mut ConnectorEvent>,
-        res: types::Response,
-    ) -> CustomResult<types::SetupMandateRouterData, errors::ConnectorError> {
+        res: Response,
+    ) -> CustomResult<SetupMandateRouterData, ConnectorError> {
         let response: nmi::StandardResponse = serde_urlencoded::from_bytes(&res.response)
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -229,27 +236,21 @@ impl
 
     fn get_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
 impl api::PaymentsPreProcessing for Nmi {}
 
-impl
-    ConnectorIntegration<
-        api::PreProcessing,
-        types::PaymentsPreProcessingData,
-        types::PaymentsResponseData,
-    > for Nmi
-{
+impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResponseData> for Nmi {
     fn get_headers(
         &self,
-        req: &types::PaymentsPreProcessingRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &PaymentsPreProcessingRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
@@ -259,37 +260,35 @@ impl
 
     fn get_url(
         &self,
-        _req: &types::PaymentsPreProcessingRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &PaymentsPreProcessingRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}api/transact.php", self.base_url(connectors)))
     }
 
     fn get_request_body(
         &self,
-        req: &types::PaymentsPreProcessingRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        req: &PaymentsPreProcessingRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
         let connector_req = nmi::NmiVaultRequest::try_from(req)?;
         Ok(RequestContent::FormUrlEncoded(Box::new(connector_req)))
     }
 
     fn build_request(
         &self,
-        req: &types::PaymentsPreProcessingRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &PaymentsPreProcessingRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         let req = Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
+            RequestBuilder::new()
+                .method(Method::Post)
                 .attach_default_headers()
-                .headers(types::PaymentsPreProcessingType::get_headers(
-                    self, req, connectors,
-                )?)
-                .url(&types::PaymentsPreProcessingType::get_url(
+                .headers(PaymentsPreProcessingType::get_headers(
                     self, req, connectors,
                 )?)
-                .set_body(types::PaymentsPreProcessingType::get_request_body(
+                .url(&PaymentsPreProcessingType::get_url(self, req, connectors)?)
+                .set_body(PaymentsPreProcessingType::get_request_body(
                     self, req, connectors,
                 )?)
                 .build(),
@@ -299,15 +298,15 @@ impl
 
     fn handle_response(
         &self,
-        data: &types::PaymentsPreProcessingRouterData,
+        data: &PaymentsPreProcessingRouterData,
         event_builder: Option<&mut ConnectorEvent>,
-        res: types::Response,
-    ) -> CustomResult<types::PaymentsPreProcessingRouterData, errors::ConnectorError> {
+        res: Response,
+    ) -> CustomResult<PaymentsPreProcessingRouterData, ConnectorError> {
         let response: nmi::NmiVaultResponse = serde_urlencoded::from_bytes(&res.response)
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -316,38 +315,36 @@ impl
 
     fn get_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
-impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData>
-    for Nmi
-{
+impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Nmi {
     fn get_headers(
         &self,
-        req: &types::PaymentsAuthorizeRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &PaymentsAuthorizeRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
     fn get_url(
         &self,
-        _req: &types::PaymentsAuthorizeRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &PaymentsAuthorizeRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}api/transact.php", self.base_url(connectors)))
     }
 
     fn get_request_body(
         &self,
-        req: &types::PaymentsAuthorizeRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
-        let amount = connector_utils::convert_amount(
+        req: &PaymentsAuthorizeRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
+        let amount = convert_amount(
             self.amount_converter,
             req.request.minor_amount,
             req.request.currency,
@@ -359,19 +356,15 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P
 
     fn build_request(
         &self,
-        req: &types::PaymentsAuthorizeRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &PaymentsAuthorizeRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&types::PaymentsAuthorizeType::get_url(
-                    self, req, connectors,
-                )?)
-                .headers(types::PaymentsAuthorizeType::get_headers(
-                    self, req, connectors,
-                )?)
-                .set_body(types::PaymentsAuthorizeType::get_request_body(
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&PaymentsAuthorizeType::get_url(self, req, connectors)?)
+                .headers(PaymentsAuthorizeType::get_headers(self, req, connectors)?)
+                .set_body(PaymentsAuthorizeType::get_request_body(
                     self, req, connectors,
                 )?)
                 .build(),
@@ -380,15 +373,15 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P
 
     fn handle_response(
         &self,
-        data: &types::PaymentsAuthorizeRouterData,
+        data: &PaymentsAuthorizeRouterData,
         event_builder: Option<&mut ConnectorEvent>,
-        res: types::Response,
-    ) -> CustomResult<types::PaymentsAuthorizeRouterData, errors::ConnectorError> {
+        res: Response,
+    ) -> CustomResult<PaymentsAuthorizeRouterData, ConnectorError> {
         let response: nmi::StandardResponse = serde_urlencoded::from_bytes(&res.response)
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -397,27 +390,21 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P
 
     fn get_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
 impl api::PaymentsCompleteAuthorize for Nmi {}
 
-impl
-    ConnectorIntegration<
-        api::CompleteAuthorize,
-        types::CompleteAuthorizeData,
-        types::PaymentsResponseData,
-    > for Nmi
-{
+impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData> for Nmi {
     fn get_headers(
         &self,
-        req: &types::PaymentsCompleteAuthorizeRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &PaymentsCompleteAuthorizeRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
     fn get_content_type(&self) -> &'static str {
@@ -425,17 +412,17 @@ impl
     }
     fn get_url(
         &self,
-        _req: &types::PaymentsCompleteAuthorizeRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &PaymentsCompleteAuthorizeRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}api/transact.php", self.base_url(connectors)))
     }
     fn get_request_body(
         &self,
-        req: &types::PaymentsCompleteAuthorizeRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
-        let amount = connector_utils::convert_amount(
+        req: &PaymentsCompleteAuthorizeRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
+        let amount = convert_amount(
             self.amount_converter,
             req.request.minor_amount,
             req.request.currency,
@@ -446,20 +433,20 @@ impl
     }
     fn build_request(
         &self,
-        req: &types::PaymentsCompleteAuthorizeRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &PaymentsCompleteAuthorizeRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&types::PaymentsCompleteAuthorizeType::get_url(
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&PaymentsCompleteAuthorizeType::get_url(
                     self, req, connectors,
                 )?)
                 .attach_default_headers()
-                .headers(types::PaymentsCompleteAuthorizeType::get_headers(
+                .headers(PaymentsCompleteAuthorizeType::get_headers(
                     self, req, connectors,
                 )?)
-                .set_body(types::PaymentsCompleteAuthorizeType::get_request_body(
+                .set_body(PaymentsCompleteAuthorizeType::get_request_body(
                     self, req, connectors,
                 )?)
                 .build(),
@@ -468,15 +455,15 @@ impl
 
     fn handle_response(
         &self,
-        data: &types::PaymentsCompleteAuthorizeRouterData,
+        data: &PaymentsCompleteAuthorizeRouterData,
         event_builder: Option<&mut ConnectorEvent>,
-        res: types::Response,
-    ) -> CustomResult<types::PaymentsCompleteAuthorizeRouterData, errors::ConnectorError> {
+        res: Response,
+    ) -> CustomResult<PaymentsCompleteAuthorizeRouterData, ConnectorError> {
         let response: nmi::NmiCompleteResponse = serde_urlencoded::from_bytes(&res.response)
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -485,69 +472,65 @@ impl
 
     fn get_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
-impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData>
-    for Nmi
-{
+impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Nmi {
     fn get_headers(
         &self,
-        req: &types::PaymentsSyncRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &PaymentsSyncRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
     fn get_url(
         &self,
-        _req: &types::PaymentsSyncRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &PaymentsSyncRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}api/query.php", self.base_url(connectors)))
     }
 
     fn get_request_body(
         &self,
-        req: &types::PaymentsSyncRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        req: &PaymentsSyncRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
         let connector_req = nmi::NmiSyncRequest::try_from(req)?;
         Ok(RequestContent::FormUrlEncoded(Box::new(connector_req)))
     }
 
     fn build_request(
         &self,
-        req: &types::PaymentsSyncRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &PaymentsSyncRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&types::PaymentsSyncType::get_url(self, req, connectors)?)
-                .headers(types::PaymentsSyncType::get_headers(self, req, connectors)?)
-                .set_body(types::PaymentsSyncType::get_request_body(
-                    self, req, connectors,
-                )?)
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&PaymentsSyncType::get_url(self, req, connectors)?)
+                .headers(PaymentsSyncType::get_headers(self, req, connectors)?)
+                .set_body(PaymentsSyncType::get_request_body(self, req, connectors)?)
                 .build(),
         ))
     }
 
     fn handle_response(
         &self,
-        data: &types::PaymentsSyncRouterData,
+        data: &PaymentsSyncRouterData,
         event_builder: Option<&mut ConnectorEvent>,
-        res: types::Response,
-    ) -> CustomResult<types::PaymentsSyncRouterData, errors::ConnectorError> {
+        res: Response,
+    ) -> CustomResult<PaymentsSyncRouterData, ConnectorError> {
         let response = nmi::SyncResponse::try_from(res.response.to_vec())?;
 
         event_builder.map(|i| i.set_response_body(&response));
 
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -556,38 +539,36 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe
 
     fn get_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
-impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData>
-    for Nmi
-{
+impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Nmi {
     fn get_headers(
         &self,
-        req: &types::PaymentsCaptureRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &PaymentsCaptureRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
     fn get_url(
         &self,
-        _req: &types::PaymentsCaptureRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &PaymentsCaptureRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}api/transact.php", self.base_url(connectors)))
     }
 
     fn get_request_body(
         &self,
-        req: &types::PaymentsCaptureRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
-        let amount = connector_utils::convert_amount(
+        req: &PaymentsCaptureRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
+        let amount = convert_amount(
             self.amount_converter,
             req.request.minor_amount_to_capture,
             req.request.currency,
@@ -599,17 +580,15 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme
 
     fn build_request(
         &self,
-        req: &types::PaymentsCaptureRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &PaymentsCaptureRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&types::PaymentsCaptureType::get_url(self, req, connectors)?)
-                .headers(types::PaymentsCaptureType::get_headers(
-                    self, req, connectors,
-                )?)
-                .set_body(types::PaymentsCaptureType::get_request_body(
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&PaymentsCaptureType::get_url(self, req, connectors)?)
+                .headers(PaymentsCaptureType::get_headers(self, req, connectors)?)
+                .set_body(PaymentsCaptureType::get_request_body(
                     self, req, connectors,
                 )?)
                 .build(),
@@ -618,15 +597,15 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme
 
     fn handle_response(
         &self,
-        data: &types::PaymentsCaptureRouterData,
+        data: &PaymentsCaptureRouterData,
         event_builder: Option<&mut ConnectorEvent>,
-        res: types::Response,
-    ) -> CustomResult<types::PaymentsCaptureRouterData, errors::ConnectorError> {
+        res: Response,
+    ) -> CustomResult<PaymentsCaptureRouterData, ConnectorError> {
         let response: nmi::StandardResponse = serde_urlencoded::from_bytes(&res.response)
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -635,69 +614,65 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme
 
     fn get_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
-impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData>
-    for Nmi
-{
+impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Nmi {
     fn get_headers(
         &self,
-        req: &types::PaymentsCancelRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &PaymentsCancelRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
     fn get_url(
         &self,
-        _req: &types::PaymentsCancelRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &PaymentsCancelRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}api/transact.php", self.base_url(connectors)))
     }
 
     fn get_request_body(
         &self,
-        req: &types::PaymentsCancelRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        req: &PaymentsCancelRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
         let connector_req = nmi::NmiCancelRequest::try_from(req)?;
         Ok(RequestContent::FormUrlEncoded(Box::new(connector_req)))
     }
 
     fn build_request(
         &self,
-        req: &types::PaymentsCancelRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &PaymentsCancelRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&types::PaymentsVoidType::get_url(self, req, connectors)?)
-                .headers(types::PaymentsVoidType::get_headers(self, req, connectors)?)
-                .set_body(types::PaymentsVoidType::get_request_body(
-                    self, req, connectors,
-                )?)
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&PaymentsVoidType::get_url(self, req, connectors)?)
+                .headers(PaymentsVoidType::get_headers(self, req, connectors)?)
+                .set_body(PaymentsVoidType::get_request_body(self, req, connectors)?)
                 .build(),
         ))
     }
 
     fn handle_response(
         &self,
-        data: &types::PaymentsCancelRouterData,
+        data: &PaymentsCancelRouterData,
         event_builder: Option<&mut ConnectorEvent>,
-        res: types::Response,
-    ) -> CustomResult<types::PaymentsCancelRouterData, errors::ConnectorError> {
+        res: Response,
+    ) -> CustomResult<PaymentsCancelRouterData, ConnectorError> {
         let response: nmi::StandardResponse = serde_urlencoded::from_bytes(&res.response)
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -706,36 +681,36 @@ impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsR
 
     fn get_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
-impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Nmi {
+impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Nmi {
     fn get_headers(
         &self,
-        req: &types::RefundsRouterData<api::Execute>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &RefundsRouterData<Execute>,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
     fn get_url(
         &self,
-        _req: &types::RefundsRouterData<api::Execute>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &RefundsRouterData<Execute>,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}api/transact.php", self.base_url(connectors)))
     }
 
     fn get_request_body(
         &self,
-        req: &types::RefundsRouterData<api::Execute>,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
-        let refund_amount = connector_utils::convert_amount(
+        req: &RefundsRouterData<Execute>,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
+        let refund_amount = convert_amount(
             self.amount_converter,
             req.request.minor_refund_amount,
             req.request.currency,
@@ -748,34 +723,30 @@ impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsRespon
 
     fn build_request(
         &self,
-        req: &types::RefundsRouterData<api::Execute>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &RefundsRouterData<Execute>,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&types::RefundExecuteType::get_url(self, req, connectors)?)
-                .headers(types::RefundExecuteType::get_headers(
-                    self, req, connectors,
-                )?)
-                .set_body(types::RefundExecuteType::get_request_body(
-                    self, req, connectors,
-                )?)
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&RefundExecuteType::get_url(self, req, connectors)?)
+                .headers(RefundExecuteType::get_headers(self, req, connectors)?)
+                .set_body(RefundExecuteType::get_request_body(self, req, connectors)?)
                 .build(),
         ))
     }
 
     fn handle_response(
         &self,
-        data: &types::RefundsRouterData<api::Execute>,
+        data: &RefundsRouterData<Execute>,
         event_builder: Option<&mut ConnectorEvent>,
-        res: types::Response,
-    ) -> CustomResult<types::RefundsRouterData<api::Execute>, errors::ConnectorError> {
+        res: Response,
+    ) -> CustomResult<RefundsRouterData<Execute>, ConnectorError> {
         let response: nmi::StandardResponse = serde_urlencoded::from_bytes(&res.response)
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -784,68 +755,66 @@ impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsRespon
 
     fn get_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
-impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for Nmi {
+impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Nmi {
     fn get_headers(
         &self,
-        req: &types::RefundsRouterData<api::RSync>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &RefundsRouterData<RSync>,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
     fn get_url(
         &self,
-        _req: &types::RefundsRouterData<api::RSync>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &RefundsRouterData<RSync>,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}api/query.php", self.base_url(connectors)))
     }
 
     fn get_request_body(
         &self,
-        req: &types::RefundsRouterData<api::RSync>,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        req: &RefundsRouterData<RSync>,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
         let connector_req = nmi::NmiSyncRequest::try_from(req)?;
         Ok(RequestContent::FormUrlEncoded(Box::new(connector_req)))
     }
 
     fn build_request(
         &self,
-        req: &types::RefundsRouterData<api::RSync>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &RefundsRouterData<RSync>,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&types::RefundSyncType::get_url(self, req, connectors)?)
-                .headers(types::RefundSyncType::get_headers(self, req, connectors)?)
-                .set_body(types::RefundSyncType::get_request_body(
-                    self, req, connectors,
-                )?)
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&RefundSyncType::get_url(self, req, connectors)?)
+                .headers(RefundSyncType::get_headers(self, req, connectors)?)
+                .set_body(RefundSyncType::get_request_body(self, req, connectors)?)
                 .build(),
         ))
     }
 
     fn handle_response(
         &self,
-        data: &types::RefundsRouterData<api::RSync>,
+        data: &RefundsRouterData<RSync>,
         event_builder: Option<&mut ConnectorEvent>,
-        res: types::Response,
-    ) -> CustomResult<types::RefundsRouterData<api::RSync>, errors::ConnectorError> {
+        res: Response,
+    ) -> CustomResult<RefundsRouterData<RSync>, ConnectorError> {
         let response = nmi::NmiRefundSyncResponse::try_from(res.response.to_vec())?;
 
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
 
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -854,81 +823,79 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse
 
     fn get_error_response(
         &self,
-        res: types::Response,
+        res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
 #[async_trait::async_trait]
-impl api::IncomingWebhook for Nmi {
+impl IncomingWebhook for Nmi {
     fn get_webhook_source_verification_algorithm(
         &self,
-        _request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<Box<dyn crypto::VerifySignature + Send>, errors::ConnectorError> {
+        _request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<Box<dyn crypto::VerifySignature + Send>, ConnectorError> {
         Ok(Box::new(crypto::HmacSha256))
     }
 
     fn get_webhook_source_verification_signature(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
+        request: &IncomingWebhookRequestDetails<'_>,
         _connector_webhook_secrets: &api_models::webhooks::ConnectorWebhookSecrets,
-    ) -> CustomResult<Vec<u8>, errors::ConnectorError> {
-        let sig_header =
-            connector_utils::get_header_key_value("webhook-signature", request.headers)?;
+    ) -> CustomResult<Vec<u8>, ConnectorError> {
+        let sig_header = get_header_key_value("webhook-signature", request.headers)?;
 
         let regex_pattern = r"t=(.*),s=(.*)";
 
         if let Some(captures) = Regex::new(regex_pattern)
-            .change_context(errors::ConnectorError::WebhookSignatureNotFound)?
+            .change_context(ConnectorError::WebhookSignatureNotFound)?
             .captures(sig_header)
         {
             let signature = captures
                 .get(1)
-                .ok_or(errors::ConnectorError::WebhookSignatureNotFound)?
+                .ok_or(ConnectorError::WebhookSignatureNotFound)?
                 .as_str();
             return Ok(signature.as_bytes().to_vec());
         }
 
-        Err(report!(errors::ConnectorError::WebhookSignatureNotFound))
+        Err(report!(ConnectorError::WebhookSignatureNotFound))
     }
 
     fn get_webhook_source_verification_message(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
+        request: &IncomingWebhookRequestDetails<'_>,
         _merchant_id: &common_utils::id_type::MerchantId,
         _connector_webhook_secrets: &api_models::webhooks::ConnectorWebhookSecrets,
-    ) -> CustomResult<Vec<u8>, errors::ConnectorError> {
-        let sig_header =
-            connector_utils::get_header_key_value("webhook-signature", request.headers)?;
+    ) -> CustomResult<Vec<u8>, ConnectorError> {
+        let sig_header = get_header_key_value("webhook-signature", request.headers)?;
 
         let regex_pattern = r"t=(.*),s=(.*)";
 
         if let Some(captures) = Regex::new(regex_pattern)
-            .change_context(errors::ConnectorError::WebhookSignatureNotFound)?
+            .change_context(ConnectorError::WebhookSignatureNotFound)?
             .captures(sig_header)
         {
             let nonce = captures
                 .get(0)
-                .ok_or(errors::ConnectorError::WebhookSignatureNotFound)?
+                .ok_or(ConnectorError::WebhookSignatureNotFound)?
                 .as_str();
 
             let message = format!("{}.{}", nonce, String::from_utf8_lossy(request.body));
 
             return Ok(message.into_bytes());
         }
-        Err(report!(errors::ConnectorError::WebhookSignatureNotFound))
+        Err(report!(ConnectorError::WebhookSignatureNotFound))
     }
 
     fn get_webhook_object_reference_id(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<api_models::webhooks::ObjectReferenceId, errors::ConnectorError> {
+        request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<api_models::webhooks::ObjectReferenceId, ConnectorError> {
         let reference_body: nmi::NmiWebhookObjectReference = request
             .body
             .parse_struct("nmi NmiWebhookObjectReference")
-            .change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
+            .change_context(ConnectorError::WebhookResourceObjectNotFound)?;
 
         let object_reference_id = match reference_body.event_body.action.action_type {
             nmi::NmiActionType::Sale => api_models::webhooks::ObjectReferenceId::PaymentId(
@@ -954,7 +921,7 @@ impl api::IncomingWebhook for Nmi {
             nmi::NmiActionType::Refund => api_models::webhooks::ObjectReferenceId::RefundId(
                 api_models::webhooks::RefundIdType::RefundId(reference_body.event_body.order_id),
             ),
-            _ => Err(errors::ConnectorError::WebhooksNotImplemented)?,
+            _ => Err(ConnectorError::WebhooksNotImplemented)?,
         };
 
         Ok(object_reference_id)
@@ -962,26 +929,26 @@ impl api::IncomingWebhook for Nmi {
 
     fn get_webhook_event_type(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> {
+        request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<IncomingWebhookEvent, ConnectorError> {
         let event_type_body: nmi::NmiWebhookEventBody = request
             .body
             .parse_struct("nmi NmiWebhookEventType")
-            .change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
+            .change_context(ConnectorError::WebhookResourceObjectNotFound)?;
 
-        Ok(api::IncomingWebhookEvent::foreign_from(
+        Ok(transformers::get_nmi_webhook_event(
             event_type_body.event_type,
         ))
     }
 
     fn get_webhook_resource_object(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+        request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
         let webhook_body: nmi::NmiWebhookBody = request
             .body
             .parse_struct("nmi NmiWebhookBody")
-            .change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
+            .change_context(ConnectorError::WebhookResourceObjectNotFound)?;
 
         match webhook_body.event_body.action.action_type {
             nmi::NmiActionType::Sale
@@ -996,33 +963,32 @@ impl api::IncomingWebhook for Nmi {
     }
 }
 
-impl services::ConnectorRedirectResponse for Nmi {
+impl ConnectorRedirectResponse for Nmi {
     fn get_flow_type(
         &self,
         _query_params: &str,
         json_payload: Option<serde_json::Value>,
-        action: services::PaymentAction,
-    ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> {
+        action: PaymentAction,
+    ) -> CustomResult<CallConnectorAction, ConnectorError> {
         match action {
-            services::PaymentAction::CompleteAuthorize => {
-                let payload_data =
-                    json_payload.ok_or(errors::ConnectorError::MissingRequiredField {
-                        field_name: "connector_metadata",
-                    })?;
+            PaymentAction::CompleteAuthorize => {
+                let payload_data = json_payload.ok_or(ConnectorError::MissingRequiredField {
+                    field_name: "connector_metadata",
+                })?;
 
                 let redirect_res: nmi::NmiRedirectResponse = serde_json::from_value(payload_data)
                     .change_context(
-                    errors::ConnectorError::MissingConnectorRedirectionPayload {
+                    ConnectorError::MissingConnectorRedirectionPayload {
                         field_name: "redirect_res",
                     },
                 )?;
 
                 match redirect_res {
                     transformers::NmiRedirectResponse::NmiRedirectResponseData(_) => {
-                        Ok(payments::CallConnectorAction::Trigger)
+                        Ok(CallConnectorAction::Trigger)
                     }
                     transformers::NmiRedirectResponse::NmiErrorResponseData(error_res) => {
-                        Ok(payments::CallConnectorAction::StatusUpdate {
+                        Ok(CallConnectorAction::StatusUpdate {
                             status: enums::AttemptStatus::Failure,
                             error_code: Some(error_res.code),
                             error_message: Some(error_res.message),
@@ -1030,9 +996,8 @@ impl services::ConnectorRedirectResponse for Nmi {
                     }
                 }
             }
-            services::PaymentAction::PSync
-            | services::PaymentAction::PaymentAuthenticateCompleteAuthorize => {
-                Ok(payments::CallConnectorAction::Trigger)
+            PaymentAction::PSync | PaymentAction::PaymentAuthenticateCompleteAuthorize => {
+                Ok(CallConnectorAction::Trigger)
             }
         }
     }
diff --git a/crates/router/src/connector/nmi/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
similarity index 62%
rename from crates/router/src/connector/nmi/transformers.rs
rename to crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
index da1231d1d8c..c8dbea3844d 100644
--- a/crates/router/src/connector/nmi/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
@@ -1,22 +1,43 @@
-use api_models::webhooks;
+use api_models::webhooks::IncomingWebhookEvent;
 use cards::CardNumber;
-use common_enums::CountryAlpha2;
+use common_enums::{
+    AttemptStatus, AuthenticationType, CaptureMethod, CountryAlpha2, Currency, RefundStatus,
+};
 use common_utils::{errors::CustomResult, ext_traits::XmlExt, pii::Email, types::FloatMajorUnit};
 use error_stack::{report, Report, ResultExt};
+use hyperswitch_domain_models::{
+    payment_method_data::{
+        ApplePayWalletData, Card, GooglePayWalletData, PaymentMethodData, WalletData,
+    },
+    router_data::{ConnectorAuthType, ErrorResponse, RouterData},
+    router_flow_types::{
+        Authorize, Capture, CompleteAuthorize, Execute, PreProcessing, RSync, SetupMandate, Void,
+    },
+    router_request_types::{
+        CompleteAuthorizeData, PaymentsAuthorizeData, PaymentsCaptureData,
+        PaymentsPreProcessingData, ResponseId,
+    },
+    router_response_types::{PaymentsResponseData, RedirectForm, RefundsResponseData},
+    types::{
+        PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
+        PaymentsCompleteAuthorizeRouterData, PaymentsPreProcessingRouterData,
+        PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData, SetupMandateRouterData,
+    },
+};
+use hyperswitch_interfaces::errors::ConnectorError;
 use masking::{ExposeInterface, PeekInterface, Secret};
 use serde::{Deserialize, Serialize};
 
 use crate::{
-    connector::utils::{
-        self, AddressDetailsData, PaymentsAuthorizeRequestData,
-        PaymentsCompleteAuthorizeRequestData, RouterData,
+    types::{PaymentsResponseRouterData, RefundsResponseRouterData, ResponseRouterData},
+    utils::{
+        get_unimplemented_payment_method_error_message, to_currency_base_unit_asf64,
+        AddressDetailsData as _, CardData as _, PaymentsAuthorizeRequestData,
+        PaymentsCompleteAuthorizeRequestData as _, RouterData as _,
     },
-    core::errors,
-    services,
-    types::{self, api, domain, storage::enums, transformers::ForeignFrom, ConnectorAuthType},
 };
 
-type Error = Report<errors::ConnectorError>;
+type Error = Report<ConnectorError>;
 
 #[derive(Debug, Serialize)]
 #[serde(rename_all = "lowercase")]
@@ -46,7 +67,7 @@ impl TryFrom<&ConnectorAuthType> for NmiAuthType {
                 api_key: api_key.to_owned(),
                 public_key: Some(key1.to_owned()),
             }),
-            _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()),
+            _ => Err(ConnectorError::FailedToObtainAuthType.into()),
         }
     }
 }
@@ -90,9 +111,9 @@ pub enum CustomerAction {
     UpdateCustomer,
 }
 
-impl TryFrom<&types::PaymentsPreProcessingRouterData> for NmiVaultRequest {
+impl TryFrom<&PaymentsPreProcessingRouterData> for NmiVaultRequest {
     type Error = Error;
-    fn try_from(item: &types::PaymentsPreProcessingRouterData) -> Result<Self, Self::Error> {
+    fn try_from(item: &PaymentsPreProcessingRouterData) -> Result<Self, Self::Error> {
         let auth_type: NmiAuthType = (&item.connector_auth_type).try_into()?;
         let (ccnumber, ccexp, cvv) = get_card_details(item.request.payment_method_data.clone())?;
         let billing_details = item.get_billing_address()?;
@@ -120,21 +141,18 @@ impl TryFrom<&types::PaymentsPreProcessingRouterData> for NmiVaultRequest {
 }
 
 fn get_card_details(
-    payment_method_data: Option<domain::PaymentMethodData>,
-) -> CustomResult<(CardNumber, Secret<String>, Secret<String>), errors::ConnectorError> {
+    payment_method_data: Option<PaymentMethodData>,
+) -> CustomResult<(CardNumber, Secret<String>, Secret<String>), ConnectorError> {
     match payment_method_data {
-        Some(domain::PaymentMethodData::Card(ref card_details)) => Ok((
+        Some(PaymentMethodData::Card(ref card_details)) => Ok((
             card_details.card_number.clone(),
-            utils::CardData::get_card_expiry_month_year_2_digit_with_delimiter(
-                card_details,
-                "".to_string(),
-            )?,
+            card_details.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?,
             card_details.card_cvc.clone(),
         )),
-        _ => Err(errors::ConnectorError::NotImplemented(
-            utils::get_unimplemented_payment_method_error_message("Nmi"),
-        )
-        .into()),
+        _ => Err(
+            ConnectorError::NotImplemented(get_unimplemented_payment_method_error_message("Nmi"))
+                .into(),
+        ),
     }
 }
 
@@ -149,59 +167,56 @@ pub struct NmiVaultResponse {
 
 impl
     TryFrom<
-        types::ResponseRouterData<
-            api::PreProcessing,
+        ResponseRouterData<
+            PreProcessing,
             NmiVaultResponse,
-            types::PaymentsPreProcessingData,
-            types::PaymentsResponseData,
+            PaymentsPreProcessingData,
+            PaymentsResponseData,
         >,
-    > for types::PaymentsPreProcessingRouterData
+    > for PaymentsPreProcessingRouterData
 {
     type Error = Error;
     fn try_from(
-        item: types::ResponseRouterData<
-            api::PreProcessing,
+        item: ResponseRouterData<
+            PreProcessing,
             NmiVaultResponse,
-            types::PaymentsPreProcessingData,
-            types::PaymentsResponseData,
+            PaymentsPreProcessingData,
+            PaymentsResponseData,
         >,
     ) -> Result<Self, Self::Error> {
         let auth_type: NmiAuthType = (&item.data.connector_auth_type).try_into()?;
-        let amount_data =
-            item.data
-                .request
-                .amount
-                .ok_or(errors::ConnectorError::MissingRequiredField {
-                    field_name: "amount",
-                })?;
+        let amount_data = item
+            .data
+            .request
+            .amount
+            .ok_or(ConnectorError::MissingRequiredField {
+                field_name: "amount",
+            })?;
         let currency_data =
             item.data
                 .request
                 .currency
-                .ok_or(errors::ConnectorError::MissingRequiredField {
+                .ok_or(ConnectorError::MissingRequiredField {
                     field_name: "currency",
                 })?;
         let (response, status) = match item.response.response {
             Response::Approved => (
-                Ok(types::PaymentsResponseData::TransactionResponse {
-                    resource_id: types::ResponseId::NoResponseId,
-                    redirection_data: Box::new(Some(services::RedirectForm::Nmi {
-                        amount: utils::to_currency_base_unit_asf64(
-                            amount_data,
-                            currency_data.to_owned(),
-                        )?
-                        .to_string(),
+                Ok(PaymentsResponseData::TransactionResponse {
+                    resource_id: ResponseId::NoResponseId,
+                    redirection_data: Box::new(Some(RedirectForm::Nmi {
+                        amount: to_currency_base_unit_asf64(amount_data, currency_data.to_owned())?
+                            .to_string(),
                         currency: currency_data,
                         customer_vault_id: item
                             .response
                             .customer_vault_id
-                            .ok_or(errors::ConnectorError::MissingRequiredField {
+                            .ok_or(ConnectorError::MissingRequiredField {
                                 field_name: "customer_vault_id",
                             })?
                             .peek()
                             .to_string(),
                         public_key: auth_type.public_key.ok_or(
-                            errors::ConnectorError::InvalidConnectorConfig {
+                            ConnectorError::InvalidConnectorConfig {
                                 config: "public_key",
                             },
                         )?,
@@ -214,10 +229,10 @@ impl
                     incremental_authorization_allowed: None,
                     charges: None,
                 }),
-                enums::AttemptStatus::AuthenticationPending,
+                AttemptStatus::AuthenticationPending,
             ),
             Response::Declined | Response::Error => (
-                Err(types::ErrorResponse {
+                Err(ErrorResponse {
                     code: item.response.response_code,
                     message: item.response.responsetext.to_owned(),
                     reason: Some(item.response.responsetext),
@@ -228,7 +243,7 @@ impl
                     network_decline_code: None,
                     network_error_message: None,
                 }),
-                enums::AttemptStatus::Failure,
+                AttemptStatus::Failure,
             ),
         };
         Ok(Self {
@@ -285,10 +300,10 @@ pub struct NmiRedirectResponseData {
     customer_vault_id: Secret<String>,
 }
 
-impl TryFrom<&NmiRouterData<&types::PaymentsCompleteAuthorizeRouterData>> for NmiCompleteRequest {
+impl TryFrom<&NmiRouterData<&PaymentsCompleteAuthorizeRouterData>> for NmiCompleteRequest {
     type Error = Error;
     fn try_from(
-        item: &NmiRouterData<&types::PaymentsCompleteAuthorizeRouterData>,
+        item: &NmiRouterData<&PaymentsCompleteAuthorizeRouterData>,
     ) -> Result<Self, Self::Error> {
         let transaction_type = match item.router_data.request.is_auto_capture()? {
             true => TransactionType::Sale,
@@ -302,7 +317,7 @@ impl TryFrom<&NmiRouterData<&types::PaymentsCompleteAuthorizeRouterData>> for Nm
             .expose();
 
         let three_ds_data: NmiRedirectResponseData = serde_json::from_value(payload_data)
-            .change_context(errors::ConnectorError::MissingConnectorRedirectionPayload {
+            .change_context(ConnectorError::MissingConnectorRedirectionPayload {
                 field_name: "three_ds_data",
             })?;
 
@@ -340,29 +355,27 @@ pub struct NmiCompleteResponse {
 
 impl
     TryFrom<
-        types::ResponseRouterData<
-            api::CompleteAuthorize,
+        ResponseRouterData<
+            CompleteAuthorize,
             NmiCompleteResponse,
-            types::CompleteAuthorizeData,
-            types::PaymentsResponseData,
+            CompleteAuthorizeData,
+            PaymentsResponseData,
         >,
-    > for types::PaymentsCompleteAuthorizeRouterData
+    > for PaymentsCompleteAuthorizeRouterData
 {
     type Error = Error;
     fn try_from(
-        item: types::ResponseRouterData<
-            api::CompleteAuthorize,
+        item: ResponseRouterData<
+            CompleteAuthorize,
             NmiCompleteResponse,
-            types::CompleteAuthorizeData,
-            types::PaymentsResponseData,
+            CompleteAuthorizeData,
+            PaymentsResponseData,
         >,
     ) -> Result<Self, Self::Error> {
         let (response, status) = match item.response.response {
             Response::Approved => (
-                Ok(types::PaymentsResponseData::TransactionResponse {
-                    resource_id: types::ResponseId::ConnectorTransactionId(
-                        item.response.transactionid,
-                    ),
+                Ok(PaymentsResponseData::TransactionResponse {
+                    resource_id: ResponseId::ConnectorTransactionId(item.response.transactionid),
                     redirection_data: Box::new(None),
                     mandate_reference: Box::new(None),
                     connector_metadata: None,
@@ -371,20 +384,15 @@ impl
                     incremental_authorization_allowed: None,
                     charges: None,
                 }),
-                if let Some(diesel_models::enums::CaptureMethod::Automatic) =
-                    item.data.request.capture_method
-                {
-                    enums::AttemptStatus::CaptureInitiated
+                if let Some(CaptureMethod::Automatic) = item.data.request.capture_method {
+                    AttemptStatus::CaptureInitiated
                 } else {
-                    enums::AttemptStatus::Authorizing
+                    AttemptStatus::Authorizing
                 },
             ),
             Response::Declined | Response::Error => (
-                Err(types::ErrorResponse::foreign_from((
-                    item.response,
-                    item.http_code,
-                ))),
-                enums::AttemptStatus::Failure,
+                Err(get_nmi_error_response(item.response, item.http_code)),
+                AttemptStatus::Failure,
             ),
         };
         Ok(Self {
@@ -395,19 +403,17 @@ impl
     }
 }
 
-impl ForeignFrom<(NmiCompleteResponse, u16)> for types::ErrorResponse {
-    fn foreign_from((response, http_code): (NmiCompleteResponse, u16)) -> Self {
-        Self {
-            code: response.response_code,
-            message: response.responsetext.to_owned(),
-            reason: Some(response.responsetext),
-            status_code: http_code,
-            attempt_status: None,
-            connector_transaction_id: Some(response.transactionid),
-            network_advice_code: None,
-            network_decline_code: None,
-            network_error_message: None,
-        }
+fn get_nmi_error_response(response: NmiCompleteResponse, http_code: u16) -> ErrorResponse {
+    ErrorResponse {
+        code: response.response_code,
+        message: response.responsetext.to_owned(),
+        reason: Some(response.responsetext),
+        status_code: http_code,
+        attempt_status: None,
+        connector_transaction_id: Some(response.transactionid),
+        network_advice_code: None,
+        network_decline_code: None,
+        network_error_message: None,
     }
 }
 
@@ -417,7 +423,7 @@ pub struct NmiPaymentsRequest {
     transaction_type: TransactionType,
     amount: FloatMajorUnit,
     security_key: Secret<String>,
-    currency: enums::Currency,
+    currency: Currency,
     #[serde(flatten)]
     payment_method: PaymentMethod,
     #[serde(flatten)]
@@ -488,11 +494,9 @@ pub struct ApplePayData {
     applepay_payment_data: Secret<String>,
 }
 
-impl TryFrom<&NmiRouterData<&types::PaymentsAuthorizeRouterData>> for NmiPaymentsRequest {
+impl TryFrom<&NmiRouterData<&PaymentsAuthorizeRouterData>> for NmiPaymentsRequest {
     type Error = Error;
-    fn try_from(
-        item: &NmiRouterData<&types::PaymentsAuthorizeRouterData>,
-    ) -> Result<Self, Self::Error> {
+    fn try_from(item: &NmiRouterData<&PaymentsAuthorizeRouterData>) -> Result<Self, Self::Error> {
         let transaction_type = match item.router_data.request.is_auto_capture()? {
             true => TransactionType::Sale,
             false => TransactionType::Auth,
@@ -521,102 +525,85 @@ impl TryFrom<&NmiRouterData<&types::PaymentsAuthorizeRouterData>> for NmiPayment
     }
 }
 
-impl
-    TryFrom<(
-        &domain::PaymentMethodData,
-        Option<&types::PaymentsAuthorizeRouterData>,
-    )> for PaymentMethod
-{
+impl TryFrom<(&PaymentMethodData, Option<&PaymentsAuthorizeRouterData>)> for PaymentMethod {
     type Error = Error;
     fn try_from(
-        item: (
-            &domain::PaymentMethodData,
-            Option<&types::PaymentsAuthorizeRouterData>,
-        ),
+        item: (&PaymentMethodData, Option<&PaymentsAuthorizeRouterData>),
     ) -> Result<Self, Self::Error> {
         let (payment_method_data, router_data) = item;
         match payment_method_data {
-            domain::PaymentMethodData::Card(ref card) => match router_data {
+            PaymentMethodData::Card(ref card) => match router_data {
                 Some(data) => match data.auth_type {
-                    common_enums::AuthenticationType::NoThreeDs => Ok(Self::try_from(card)?),
-                    common_enums::AuthenticationType::ThreeDs => {
-                        Ok(Self::try_from((card, &data.request))?)
-                    }
+                    AuthenticationType::NoThreeDs => Ok(Self::try_from(card)?),
+                    AuthenticationType::ThreeDs => Ok(Self::try_from((card, &data.request))?),
                 },
                 None => Ok(Self::try_from(card)?),
             },
-            domain::PaymentMethodData::Wallet(ref wallet_type) => match wallet_type {
-                domain::WalletData::GooglePay(ref googlepay_data) => Ok(Self::from(googlepay_data)),
-                domain::WalletData::ApplePay(ref applepay_data) => Ok(Self::from(applepay_data)),
-                domain::WalletData::AliPayQr(_)
-                | domain::WalletData::AliPayRedirect(_)
-                | domain::WalletData::AliPayHkRedirect(_)
-                | domain::WalletData::AmazonPayRedirect(_)
-                | domain::WalletData::MomoRedirect(_)
-                | domain::WalletData::KakaoPayRedirect(_)
-                | domain::WalletData::GoPayRedirect(_)
-                | domain::WalletData::GcashRedirect(_)
-                | domain::WalletData::ApplePayRedirect(_)
-                | domain::WalletData::ApplePayThirdPartySdk(_)
-                | domain::WalletData::DanaRedirect {}
-                | domain::WalletData::GooglePayRedirect(_)
-                | domain::WalletData::GooglePayThirdPartySdk(_)
-                | domain::WalletData::MbWayRedirect(_)
-                | domain::WalletData::MobilePayRedirect(_)
-                | domain::WalletData::PaypalRedirect(_)
-                | domain::WalletData::PaypalSdk(_)
-                | domain::WalletData::Paze(_)
-                | domain::WalletData::SamsungPay(_)
-                | domain::WalletData::TwintRedirect {}
-                | domain::WalletData::VippsRedirect {}
-                | domain::WalletData::TouchNGoRedirect(_)
-                | domain::WalletData::WeChatPayRedirect(_)
-                | domain::WalletData::WeChatPayQr(_)
-                | domain::WalletData::CashappQr(_)
-                | domain::WalletData::SwishQr(_)
-                | domain::WalletData::Mifinity(_) => {
-                    Err(report!(errors::ConnectorError::NotImplemented(
-                        utils::get_unimplemented_payment_method_error_message("nmi"),
-                    )))
-                }
+            PaymentMethodData::Wallet(ref wallet_type) => match wallet_type {
+                WalletData::GooglePay(ref googlepay_data) => Ok(Self::from(googlepay_data)),
+                WalletData::ApplePay(ref applepay_data) => Ok(Self::from(applepay_data)),
+                WalletData::AliPayQr(_)
+                | WalletData::AliPayRedirect(_)
+                | WalletData::AliPayHkRedirect(_)
+                | WalletData::AmazonPayRedirect(_)
+                | WalletData::MomoRedirect(_)
+                | WalletData::KakaoPayRedirect(_)
+                | WalletData::GoPayRedirect(_)
+                | WalletData::GcashRedirect(_)
+                | WalletData::ApplePayRedirect(_)
+                | WalletData::ApplePayThirdPartySdk(_)
+                | WalletData::DanaRedirect {}
+                | WalletData::GooglePayRedirect(_)
+                | WalletData::GooglePayThirdPartySdk(_)
+                | WalletData::MbWayRedirect(_)
+                | WalletData::MobilePayRedirect(_)
+                | WalletData::PaypalRedirect(_)
+                | WalletData::PaypalSdk(_)
+                | WalletData::Paze(_)
+                | WalletData::SamsungPay(_)
+                | WalletData::TwintRedirect {}
+                | WalletData::VippsRedirect {}
+                | WalletData::TouchNGoRedirect(_)
+                | WalletData::WeChatPayRedirect(_)
+                | WalletData::WeChatPayQr(_)
+                | WalletData::CashappQr(_)
+                | WalletData::SwishQr(_)
+                | WalletData::Mifinity(_) => Err(report!(ConnectorError::NotImplemented(
+                    get_unimplemented_payment_method_error_message("nmi"),
+                ))),
             },
-            domain::PaymentMethodData::CardRedirect(_)
-            | domain::PaymentMethodData::PayLater(_)
-            | domain::PaymentMethodData::BankRedirect(_)
-            | domain::PaymentMethodData::BankDebit(_)
-            | domain::PaymentMethodData::BankTransfer(_)
-            | domain::PaymentMethodData::Crypto(_)
-            | domain::PaymentMethodData::MandatePayment
-            | domain::PaymentMethodData::Reward
-            | domain::PaymentMethodData::RealTimePayment(_)
-            | domain::PaymentMethodData::MobilePayment(_)
-            | domain::PaymentMethodData::Upi(_)
-            | domain::PaymentMethodData::Voucher(_)
-            | domain::PaymentMethodData::GiftCard(_)
-            | domain::PaymentMethodData::OpenBanking(_)
-            | domain::PaymentMethodData::CardToken(_)
-            | domain::PaymentMethodData::NetworkToken(_)
-            | domain::PaymentMethodData::CardDetailsForNetworkTransactionId(_) => {
-                Err(errors::ConnectorError::NotImplemented(
-                    utils::get_unimplemented_payment_method_error_message("nmi"),
-                )
-                .into())
-            }
+            PaymentMethodData::CardRedirect(_)
+            | PaymentMethodData::PayLater(_)
+            | PaymentMethodData::BankRedirect(_)
+            | PaymentMethodData::BankDebit(_)
+            | PaymentMethodData::BankTransfer(_)
+            | PaymentMethodData::Crypto(_)
+            | PaymentMethodData::MandatePayment
+            | PaymentMethodData::Reward
+            | PaymentMethodData::RealTimePayment(_)
+            | PaymentMethodData::MobilePayment(_)
+            | PaymentMethodData::Upi(_)
+            | PaymentMethodData::Voucher(_)
+            | PaymentMethodData::GiftCard(_)
+            | PaymentMethodData::OpenBanking(_)
+            | PaymentMethodData::CardToken(_)
+            | PaymentMethodData::NetworkToken(_)
+            | PaymentMethodData::CardDetailsForNetworkTransactionId(_) => Err(
+                ConnectorError::NotImplemented(get_unimplemented_payment_method_error_message(
+                    "nmi",
+                ))
+                .into(),
+            ),
         }
     }
 }
 
-impl TryFrom<(&domain::payments::Card, &types::PaymentsAuthorizeData)> for PaymentMethod {
+impl TryFrom<(&Card, &PaymentsAuthorizeData)> for PaymentMethod {
     type Error = Error;
-    fn try_from(
-        val: (&domain::payments::Card, &types::PaymentsAuthorizeData),
-    ) -> Result<Self, Self::Error> {
+    fn try_from(val: (&Card, &PaymentsAuthorizeData)) -> Result<Self, Self::Error> {
         let (card_data, item) = val;
         let auth_data = &item.get_authentication_data()?;
-        let ccexp = utils::CardData::get_card_expiry_month_year_2_digit_with_delimiter(
-            card_data,
-            "".to_string(),
-        )?;
+        let ccexp = card_data.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?;
 
         let card_3ds_details = CardThreeDsData {
             ccnumber: card_data.card_number.clone(),
@@ -640,13 +627,10 @@ impl TryFrom<(&domain::payments::Card, &types::PaymentsAuthorizeData)> for Payme
     }
 }
 
-impl TryFrom<&domain::payments::Card> for PaymentMethod {
+impl TryFrom<&Card> for PaymentMethod {
     type Error = Error;
-    fn try_from(card: &domain::payments::Card) -> Result<Self, Self::Error> {
-        let ccexp = utils::CardData::get_card_expiry_month_year_2_digit_with_delimiter(
-            card,
-            "".to_string(),
-        )?;
+    fn try_from(card: &Card) -> Result<Self, Self::Error> {
+        let ccexp = card.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?;
         let card = CardData {
             ccnumber: card.card_number.clone(),
             ccexp,
@@ -656,8 +640,8 @@ impl TryFrom<&domain::payments::Card> for PaymentMethod {
     }
 }
 
-impl From<&domain::GooglePayWalletData> for PaymentMethod {
-    fn from(wallet_data: &domain::GooglePayWalletData) -> Self {
+impl From<&GooglePayWalletData> for PaymentMethod {
+    fn from(wallet_data: &GooglePayWalletData) -> Self {
         let gpay_data = GooglePayData {
             googlepay_payment_data: Secret::new(wallet_data.tokenization_data.token.clone()),
         };
@@ -665,8 +649,8 @@ impl From<&domain::GooglePayWalletData> for PaymentMethod {
     }
 }
 
-impl From<&domain::ApplePayWalletData> for PaymentMethod {
-    fn from(wallet_data: &domain::ApplePayWalletData) -> Self {
+impl From<&ApplePayWalletData> for PaymentMethod {
+    fn from(wallet_data: &ApplePayWalletData) -> Self {
         let apple_pay_data = ApplePayData {
             applepay_payment_data: Secret::new(wallet_data.payment_data.clone()),
         };
@@ -674,9 +658,9 @@ impl From<&domain::ApplePayWalletData> for PaymentMethod {
     }
 }
 
-impl TryFrom<&types::SetupMandateRouterData> for NmiPaymentsRequest {
+impl TryFrom<&SetupMandateRouterData> for NmiPaymentsRequest {
     type Error = Error;
-    fn try_from(item: &types::SetupMandateRouterData) -> Result<Self, Self::Error> {
+    fn try_from(item: &SetupMandateRouterData) -> Result<Self, Self::Error> {
         let auth_type: NmiAuthType = (&item.connector_auth_type).try_into()?;
         let payment_method = PaymentMethod::try_from((&item.request.payment_method_data, None))?;
         Ok(Self {
@@ -697,9 +681,9 @@ pub struct NmiSyncRequest {
     pub security_key: Secret<String>,
 }
 
-impl TryFrom<&types::PaymentsSyncRouterData> for NmiSyncRequest {
+impl TryFrom<&PaymentsSyncRouterData> for NmiSyncRequest {
     type Error = Error;
-    fn try_from(item: &types::PaymentsSyncRouterData) -> Result<Self, Self::Error> {
+    fn try_from(item: &PaymentsSyncRouterData) -> Result<Self, Self::Error> {
         let auth = NmiAuthType::try_from(&item.connector_auth_type)?;
         Ok(Self {
             security_key: auth.api_key,
@@ -717,11 +701,9 @@ pub struct NmiCaptureRequest {
     pub amount: Option<FloatMajorUnit>,
 }
 
-impl TryFrom<&NmiRouterData<&types::PaymentsCaptureRouterData>> for NmiCaptureRequest {
+impl TryFrom<&NmiRouterData<&PaymentsCaptureRouterData>> for NmiCaptureRequest {
     type Error = Error;
-    fn try_from(
-        item: &NmiRouterData<&types::PaymentsCaptureRouterData>,
-    ) -> Result<Self, Self::Error> {
+    fn try_from(item: &NmiRouterData<&PaymentsCaptureRouterData>) -> Result<Self, Self::Error> {
         let auth = NmiAuthType::try_from(&item.router_data.connector_auth_type)?;
         Ok(Self {
             transaction_type: TransactionType::Capture,
@@ -734,27 +716,22 @@ impl TryFrom<&NmiRouterData<&types::PaymentsCaptureRouterData>> for NmiCaptureRe
 
 impl
     TryFrom<
-        types::ResponseRouterData<
-            api::Capture,
-            StandardResponse,
-            types::PaymentsCaptureData,
-            types::PaymentsResponseData,
-        >,
-    > for types::RouterData<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData>
+        ResponseRouterData<Capture, StandardResponse, PaymentsCaptureData, PaymentsResponseData>,
+    > for RouterData<Capture, PaymentsCaptureData, PaymentsResponseData>
 {
     type Error = Error;
     fn try_from(
-        item: types::ResponseRouterData<
-            api::Capture,
+        item: ResponseRouterData<
+            Capture,
             StandardResponse,
-            types::PaymentsCaptureData,
-            types::PaymentsResponseData,
+            PaymentsCaptureData,
+            PaymentsResponseData,
         >,
     ) -> Result<Self, Self::Error> {
         let (response, status) = match item.response.response {
             Response::Approved => (
-                Ok(types::PaymentsResponseData::TransactionResponse {
-                    resource_id: types::ResponseId::ConnectorTransactionId(
+                Ok(PaymentsResponseData::TransactionResponse {
+                    resource_id: ResponseId::ConnectorTransactionId(
                         item.response.transactionid.to_owned(),
                     ),
                     redirection_data: Box::new(None),
@@ -765,14 +742,11 @@ impl
                     incremental_authorization_allowed: None,
                     charges: None,
                 }),
-                enums::AttemptStatus::CaptureInitiated,
+                AttemptStatus::CaptureInitiated,
             ),
             Response::Declined | Response::Error => (
-                Err(types::ErrorResponse::foreign_from((
-                    item.response,
-                    item.http_code,
-                ))),
-                enums::AttemptStatus::CaptureFailed,
+                Err(get_standard_error_response(item.response, item.http_code)),
+                AttemptStatus::CaptureFailed,
             ),
         };
         Ok(Self {
@@ -803,14 +777,14 @@ pub enum NmiVoidReason {
     PosTimeout,
 }
 
-impl TryFrom<&types::PaymentsCancelRouterData> for NmiCancelRequest {
+impl TryFrom<&PaymentsCancelRouterData> for NmiCancelRequest {
     type Error = Error;
-    fn try_from(item: &types::PaymentsCancelRouterData) -> Result<Self, Self::Error> {
+    fn try_from(item: &PaymentsCancelRouterData) -> Result<Self, Self::Error> {
         let auth = NmiAuthType::try_from(&item.connector_auth_type)?;
         match &item.request.cancellation_reason {
             Some(cancellation_reason) => {
                 let void_reason: NmiVoidReason = serde_json::from_str(&format!("\"{}\"", cancellation_reason))
-                    .map_err(|_| errors::ConnectorError::NotSupported {
+                    .map_err(|_| ConnectorError::NotSupported {
                         message: format!("Json deserialise error: unknown variant `{}` expected to be one of `fraud`, `user_cancel`, `icc_rejected`,  `icc_card_removed`, `icc_no_confirmation`, `pos_timeout`. This cancellation_reason", cancellation_reason), 
                         connector: "nmi" 
                     })?;
@@ -821,7 +795,7 @@ impl TryFrom<&types::PaymentsCancelRouterData> for NmiCancelRequest {
                     void_reason,
                 })
             }
-            None => Err(errors::ConnectorError::MissingRequiredField {
+            None => Err(ConnectorError::MissingRequiredField {
                 field_name: "cancellation_reason",
             }
             .into()),
@@ -851,29 +825,17 @@ pub struct StandardResponse {
     pub response_code: String,
 }
 
-impl<T>
-    TryFrom<
-        types::ResponseRouterData<
-            api::SetupMandate,
-            StandardResponse,
-            T,
-            types::PaymentsResponseData,
-        >,
-    > for types::RouterData<api::SetupMandate, T, types::PaymentsResponseData>
+impl<T> TryFrom<ResponseRouterData<SetupMandate, StandardResponse, T, PaymentsResponseData>>
+    for RouterData<SetupMandate, T, PaymentsResponseData>
 {
     type Error = Error;
     fn try_from(
-        item: types::ResponseRouterData<
-            api::SetupMandate,
-            StandardResponse,
-            T,
-            types::PaymentsResponseData,
-        >,
+        item: ResponseRouterData<SetupMandate, StandardResponse, T, PaymentsResponseData>,
     ) -> Result<Self, Self::Error> {
         let (response, status) = match item.response.response {
             Response::Approved => (
-                Ok(types::PaymentsResponseData::TransactionResponse {
-                    resource_id: types::ResponseId::ConnectorTransactionId(
+                Ok(PaymentsResponseData::TransactionResponse {
+                    resource_id: ResponseId::ConnectorTransactionId(
                         item.response.transactionid.clone(),
                     ),
                     redirection_data: Box::new(None),
@@ -884,14 +846,11 @@ impl<T>
                     incremental_authorization_allowed: None,
                     charges: None,
                 }),
-                enums::AttemptStatus::Charged,
+                AttemptStatus::Charged,
             ),
             Response::Declined | Response::Error => (
-                Err(types::ErrorResponse::foreign_from((
-                    item.response,
-                    item.http_code,
-                ))),
-                enums::AttemptStatus::Failure,
+                Err(get_standard_error_response(item.response, item.http_code)),
+                AttemptStatus::Failure,
             ),
         };
         Ok(Self {
@@ -901,39 +860,36 @@ impl<T>
         })
     }
 }
-
-impl ForeignFrom<(StandardResponse, u16)> for types::ErrorResponse {
-    fn foreign_from((response, http_code): (StandardResponse, u16)) -> Self {
-        Self {
-            code: response.response_code,
-            message: response.responsetext.to_owned(),
-            reason: Some(response.responsetext),
-            status_code: http_code,
-            attempt_status: None,
-            connector_transaction_id: Some(response.transactionid),
-            network_advice_code: None,
-            network_decline_code: None,
-            network_error_message: None,
-        }
+fn get_standard_error_response(response: StandardResponse, http_code: u16) -> ErrorResponse {
+    ErrorResponse {
+        code: response.response_code,
+        message: response.responsetext.to_owned(),
+        reason: Some(response.responsetext),
+        status_code: http_code,
+        attempt_status: None,
+        connector_transaction_id: Some(response.transactionid),
+        network_advice_code: None,
+        network_decline_code: None,
+        network_error_message: None,
     }
 }
 
-impl TryFrom<types::PaymentsResponseRouterData<StandardResponse>>
-    for types::RouterData<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData>
+impl TryFrom<PaymentsResponseRouterData<StandardResponse>>
+    for RouterData<Authorize, PaymentsAuthorizeData, PaymentsResponseData>
 {
     type Error = Error;
     fn try_from(
-        item: types::ResponseRouterData<
-            api::Authorize,
+        item: ResponseRouterData<
+            Authorize,
             StandardResponse,
-            types::PaymentsAuthorizeData,
-            types::PaymentsResponseData,
+            PaymentsAuthorizeData,
+            PaymentsResponseData,
         >,
     ) -> Result<Self, Self::Error> {
         let (response, status) = match item.response.response {
             Response::Approved => (
-                Ok(types::PaymentsResponseData::TransactionResponse {
-                    resource_id: types::ResponseId::ConnectorTransactionId(
+                Ok(PaymentsResponseData::TransactionResponse {
+                    resource_id: ResponseId::ConnectorTransactionId(
                         item.response.transactionid.clone(),
                     ),
                     redirection_data: Box::new(None),
@@ -944,20 +900,15 @@ impl TryFrom<types::PaymentsResponseRouterData<StandardResponse>>
                     incremental_authorization_allowed: None,
                     charges: None,
                 }),
-                if let Some(diesel_models::enums::CaptureMethod::Automatic) =
-                    item.data.request.capture_method
-                {
-                    enums::AttemptStatus::CaptureInitiated
+                if let Some(CaptureMethod::Automatic) = item.data.request.capture_method {
+                    AttemptStatus::CaptureInitiated
                 } else {
-                    enums::AttemptStatus::Authorized
+                    AttemptStatus::Authorized
                 },
             ),
             Response::Declined | Response::Error => (
-                Err(types::ErrorResponse::foreign_from((
-                    item.response,
-                    item.http_code,
-                ))),
-                enums::AttemptStatus::Failure,
+                Err(get_standard_error_response(item.response, item.http_code)),
+                AttemptStatus::Failure,
             ),
         };
         Ok(Self {
@@ -968,23 +919,17 @@ impl TryFrom<types::PaymentsResponseRouterData<StandardResponse>>
     }
 }
 
-impl<T>
-    TryFrom<types::ResponseRouterData<api::Void, StandardResponse, T, types::PaymentsResponseData>>
-    for types::RouterData<api::Void, T, types::PaymentsResponseData>
+impl<T> TryFrom<ResponseRouterData<Void, StandardResponse, T, PaymentsResponseData>>
+    for RouterData<Void, T, PaymentsResponseData>
 {
     type Error = Error;
     fn try_from(
-        item: types::ResponseRouterData<
-            api::Void,
-            StandardResponse,
-            T,
-            types::PaymentsResponseData,
-        >,
+        item: ResponseRouterData<Void, StandardResponse, T, PaymentsResponseData>,
     ) -> Result<Self, Self::Error> {
         let (response, status) = match item.response.response {
             Response::Approved => (
-                Ok(types::PaymentsResponseData::TransactionResponse {
-                    resource_id: types::ResponseId::ConnectorTransactionId(
+                Ok(PaymentsResponseData::TransactionResponse {
+                    resource_id: ResponseId::ConnectorTransactionId(
                         item.response.transactionid.clone(),
                     ),
                     redirection_data: Box::new(None),
@@ -995,14 +940,11 @@ impl<T>
                     incremental_authorization_allowed: None,
                     charges: None,
                 }),
-                enums::AttemptStatus::VoidInitiated,
+                AttemptStatus::VoidInitiated,
             ),
             Response::Declined | Response::Error => (
-                Err(types::ErrorResponse::foreign_from((
-                    item.response,
-                    item.http_code,
-                ))),
-                enums::AttemptStatus::VoidFailed,
+                Err(get_standard_error_response(item.response, item.http_code)),
+                AttemptStatus::VoidFailed,
             ),
         };
         Ok(Self {
@@ -1026,18 +968,18 @@ pub enum NmiStatus {
     Unknown,
 }
 
-impl<F, T> TryFrom<types::ResponseRouterData<F, SyncResponse, T, types::PaymentsResponseData>>
-    for types::RouterData<F, T, types::PaymentsResponseData>
+impl<F, T> TryFrom<ResponseRouterData<F, SyncResponse, T, PaymentsResponseData>>
+    for RouterData<F, T, PaymentsResponseData>
 {
     type Error = Error;
     fn try_from(
-        item: types::ResponseRouterData<F, SyncResponse, T, types::PaymentsResponseData>,
+        item: ResponseRouterData<F, SyncResponse, T, PaymentsResponseData>,
     ) -> Result<Self, Self::Error> {
         match item.response.transaction {
             Some(trn) => Ok(Self {
-                status: enums::AttemptStatus::from(NmiStatus::from(trn.condition)),
-                response: Ok(types::PaymentsResponseData::TransactionResponse {
-                    resource_id: types::ResponseId::ConnectorTransactionId(trn.transaction_id),
+                status: AttemptStatus::from(NmiStatus::from(trn.condition)),
+                response: Ok(PaymentsResponseData::TransactionResponse {
+                    resource_id: ResponseId::ConnectorTransactionId(trn.transaction_id),
                     redirection_data: Box::new(None),
                     mandate_reference: Box::new(None),
                     connector_metadata: None,
@@ -1057,10 +999,10 @@ impl TryFrom<Vec<u8>> for SyncResponse {
     type Error = Error;
     fn try_from(bytes: Vec<u8>) -> Result<Self, Self::Error> {
         let query_response = String::from_utf8(bytes)
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         query_response
             .parse_xml::<Self>()
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)
+            .change_context(ConnectorError::ResponseDeserializationFailed)
     }
 }
 
@@ -1068,14 +1010,14 @@ impl TryFrom<Vec<u8>> for NmiRefundSyncResponse {
     type Error = Error;
     fn try_from(bytes: Vec<u8>) -> Result<Self, Self::Error> {
         let query_response = String::from_utf8(bytes)
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         query_response
             .parse_xml::<Self>()
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)
+            .change_context(ConnectorError::ResponseDeserializationFailed)
     }
 }
 
-impl From<NmiStatus> for enums::AttemptStatus {
+impl From<NmiStatus> for AttemptStatus {
     fn from(item: NmiStatus) -> Self {
         match item {
             NmiStatus::Abandoned => Self::AuthenticationFailed,
@@ -1099,9 +1041,9 @@ pub struct NmiRefundRequest {
     amount: FloatMajorUnit,
 }
 
-impl<F> TryFrom<&NmiRouterData<&types::RefundsRouterData<F>>> for NmiRefundRequest {
+impl<F> TryFrom<&NmiRouterData<&RefundsRouterData<F>>> for NmiRefundRequest {
     type Error = Error;
-    fn try_from(item: &NmiRouterData<&types::RefundsRouterData<F>>) -> Result<Self, Self::Error> {
+    fn try_from(item: &NmiRouterData<&RefundsRouterData<F>>) -> Result<Self, Self::Error> {
         let auth_type: NmiAuthType = (&item.router_data.connector_auth_type).try_into()?;
         Ok(Self {
             transaction_type: TransactionType::Refund,
@@ -1113,16 +1055,14 @@ impl<F> TryFrom<&NmiRouterData<&types::RefundsRouterData<F>>> for NmiRefundReque
     }
 }
 
-impl TryFrom<types::RefundsResponseRouterData<api::Execute, StandardResponse>>
-    for types::RefundsRouterData<api::Execute>
-{
+impl TryFrom<RefundsResponseRouterData<Execute, StandardResponse>> for RefundsRouterData<Execute> {
     type Error = Error;
     fn try_from(
-        item: types::RefundsResponseRouterData<api::Execute, StandardResponse>,
+        item: RefundsResponseRouterData<Execute, StandardResponse>,
     ) -> Result<Self, Self::Error> {
-        let refund_status = enums::RefundStatus::from(item.response.response);
+        let refund_status = RefundStatus::from(item.response.response);
         Ok(Self {
-            response: Ok(types::RefundsResponseData {
+            response: Ok(RefundsResponseData {
                 connector_refund_id: item.response.orderid,
                 refund_status,
             }),
@@ -1131,16 +1071,14 @@ impl TryFrom<types::RefundsResponseRouterData<api::Execute, StandardResponse>>
     }
 }
 
-impl TryFrom<types::RefundsResponseRouterData<api::Capture, StandardResponse>>
-    for types::RefundsRouterData<api::Capture>
-{
+impl TryFrom<RefundsResponseRouterData<Capture, StandardResponse>> for RefundsRouterData<Capture> {
     type Error = Error;
     fn try_from(
-        item: types::RefundsResponseRouterData<api::Capture, StandardResponse>,
+        item: RefundsResponseRouterData<Capture, StandardResponse>,
     ) -> Result<Self, Self::Error> {
-        let refund_status = enums::RefundStatus::from(item.response.response);
+        let refund_status = RefundStatus::from(item.response.response);
         Ok(Self {
-            response: Ok(types::RefundsResponseData {
+            response: Ok(RefundsResponseData {
                 connector_refund_id: item.response.transactionid,
                 refund_status,
             }),
@@ -1149,7 +1087,7 @@ impl TryFrom<types::RefundsResponseRouterData<api::Capture, StandardResponse>>
     }
 }
 
-impl From<Response> for enums::RefundStatus {
+impl From<Response> for RefundStatus {
     fn from(item: Response) -> Self {
         match item {
             Response::Approved => Self::Pending,
@@ -1158,9 +1096,9 @@ impl From<Response> for enums::RefundStatus {
     }
 }
 
-impl TryFrom<&types::RefundSyncRouterData> for NmiSyncRequest {
+impl TryFrom<&RefundSyncRouterData> for NmiSyncRequest {
     type Error = Error;
-    fn try_from(item: &types::RefundSyncRouterData) -> Result<Self, Self::Error> {
+    fn try_from(item: &RefundSyncRouterData) -> Result<Self, Self::Error> {
         let auth = NmiAuthType::try_from(&item.connector_auth_type)?;
 
         Ok(Self {
@@ -1169,22 +1107,20 @@ impl TryFrom<&types::RefundSyncRouterData> for NmiSyncRequest {
                 .request
                 .connector_refund_id
                 .clone()
-                .ok_or(errors::ConnectorError::MissingConnectorRefundID)?,
+                .ok_or(ConnectorError::MissingConnectorRefundID)?,
         })
     }
 }
 
-impl TryFrom<types::RefundsResponseRouterData<api::RSync, NmiRefundSyncResponse>>
-    for types::RefundsRouterData<api::RSync>
-{
-    type Error = Report<errors::ConnectorError>;
+impl TryFrom<RefundsResponseRouterData<RSync, NmiRefundSyncResponse>> for RefundsRouterData<RSync> {
+    type Error = Report<ConnectorError>;
     fn try_from(
-        item: types::RefundsResponseRouterData<api::RSync, NmiRefundSyncResponse>,
+        item: RefundsResponseRouterData<RSync, NmiRefundSyncResponse>,
     ) -> Result<Self, Self::Error> {
         let refund_status =
-            enums::RefundStatus::from(NmiStatus::from(item.response.transaction.condition));
+            RefundStatus::from(NmiStatus::from(item.response.transaction.condition));
         Ok(Self {
-            response: Ok(types::RefundsResponseData {
+            response: Ok(RefundsResponseData {
                 connector_refund_id: item.response.transaction.order_id,
                 refund_status,
             }),
@@ -1193,7 +1129,7 @@ impl TryFrom<types::RefundsResponseRouterData<api::RSync, NmiRefundSyncResponse>
     }
 }
 
-impl From<NmiStatus> for enums::RefundStatus {
+impl From<NmiStatus> for RefundStatus {
     fn from(item: NmiStatus) -> Self {
         match item {
             NmiStatus::Abandoned
@@ -1310,25 +1246,23 @@ pub enum NmiWebhookEventType {
     CaptureUnknown,
 }
 
-impl ForeignFrom<NmiWebhookEventType> for webhooks::IncomingWebhookEvent {
-    fn foreign_from(status: NmiWebhookEventType) -> Self {
-        match status {
-            NmiWebhookEventType::SaleSuccess => Self::PaymentIntentSuccess,
-            NmiWebhookEventType::SaleFailure => Self::PaymentIntentFailure,
-            NmiWebhookEventType::RefundSuccess => Self::RefundSuccess,
-            NmiWebhookEventType::RefundFailure => Self::RefundFailure,
-            NmiWebhookEventType::VoidSuccess => Self::PaymentIntentCancelled,
-            NmiWebhookEventType::AuthSuccess => Self::PaymentIntentAuthorizationSuccess,
-            NmiWebhookEventType::CaptureSuccess => Self::PaymentIntentCaptureSuccess,
-            NmiWebhookEventType::AuthFailure => Self::PaymentIntentAuthorizationFailure,
-            NmiWebhookEventType::CaptureFailure => Self::PaymentIntentCaptureFailure,
-            NmiWebhookEventType::VoidFailure => Self::PaymentIntentCancelFailure,
-            NmiWebhookEventType::SaleUnknown
-            | NmiWebhookEventType::RefundUnknown
-            | NmiWebhookEventType::AuthUnknown
-            | NmiWebhookEventType::VoidUnknown
-            | NmiWebhookEventType::CaptureUnknown => Self::EventNotSupported,
-        }
+pub fn get_nmi_webhook_event(status: NmiWebhookEventType) -> IncomingWebhookEvent {
+    match status {
+        NmiWebhookEventType::SaleSuccess => IncomingWebhookEvent::PaymentIntentSuccess,
+        NmiWebhookEventType::SaleFailure => IncomingWebhookEvent::PaymentIntentFailure,
+        NmiWebhookEventType::RefundSuccess => IncomingWebhookEvent::RefundSuccess,
+        NmiWebhookEventType::RefundFailure => IncomingWebhookEvent::RefundFailure,
+        NmiWebhookEventType::VoidSuccess => IncomingWebhookEvent::PaymentIntentCancelled,
+        NmiWebhookEventType::AuthSuccess => IncomingWebhookEvent::PaymentIntentAuthorizationSuccess,
+        NmiWebhookEventType::CaptureSuccess => IncomingWebhookEvent::PaymentIntentCaptureSuccess,
+        NmiWebhookEventType::AuthFailure => IncomingWebhookEvent::PaymentIntentAuthorizationFailure,
+        NmiWebhookEventType::CaptureFailure => IncomingWebhookEvent::PaymentIntentCaptureFailure,
+        NmiWebhookEventType::VoidFailure => IncomingWebhookEvent::PaymentIntentCancelFailure,
+        NmiWebhookEventType::SaleUnknown
+        | NmiWebhookEventType::RefundUnknown
+        | NmiWebhookEventType::AuthUnknown
+        | NmiWebhookEventType::VoidUnknown
+        | NmiWebhookEventType::CaptureUnknown => IncomingWebhookEvent::EventNotSupported,
     }
 }
 
diff --git a/crates/router/src/connector/payone.rs b/crates/hyperswitch_connectors/src/connectors/payone.rs
similarity index 57%
rename from crates/router/src/connector/payone.rs
rename to crates/hyperswitch_connectors/src/connectors/payone.rs
index db862274fe1..ca3e9b2cba9 100644
--- a/crates/router/src/connector/payone.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payone.rs
@@ -1,44 +1,73 @@
 pub mod transformers;
 
+use api_models::webhooks::{IncomingWebhookEvent, ObjectReferenceId};
 use base64::Engine;
 #[cfg(feature = "payouts")]
 use common_utils::request::RequestContent;
+use common_utils::{consts::BASE64_ENGINE, errors::CustomResult, ext_traits::BytesExt};
 #[cfg(feature = "payouts")]
-use common_utils::types::{AmountConvertor, MinorUnit, MinorUnitForConnector};
+use common_utils::{
+    request::{Method, Request, RequestBuilder},
+    types::{AmountConvertor, MinorUnit, MinorUnitForConnector},
+};
 use error_stack::{report, ResultExt};
-use masking::{ExposeInterface, PeekInterface};
+#[cfg(feature = "payouts")]
+use hyperswitch_domain_models::{
+    router_data::RouterData,
+    router_flow_types::PoFulfill,
+    types::{PayoutsData, PayoutsResponseData, PayoutsRouterData},
+};
+use hyperswitch_domain_models::{
+    router_data::{AccessToken, ConnectorAuthType, ErrorResponse},
+    router_flow_types::{
+        AccessTokenAuth, Authorize, Capture, Execute, PSync, PaymentMethodToken, RSync, Session,
+        SetupMandate, Void,
+    },
+    router_request_types::{
+        AccessTokenRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData,
+        PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
+        RefundsData, SetupMandateRequestData,
+    },
+    router_response_types::{PaymentsResponseData, RefundsResponseData},
+};
+use hyperswitch_interfaces::{
+    api::{
+        ConnectorAccessToken, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration,
+        ConnectorSpecifications, ConnectorValidation, CurrencyUnit, MandateSetup, Payment,
+        PaymentAuthorize, PaymentCapture, PaymentSession, PaymentSync, PaymentToken, PaymentVoid,
+        Refund, RefundExecute, RefundSync,
+    },
+    configs::Connectors,
+    consts::{NO_ERROR_CODE, NO_ERROR_MESSAGE},
+    errors::ConnectorError,
+    events::connector_api_logs::ConnectorEvent,
+    types::Response,
+    webhooks::{IncomingWebhook, IncomingWebhookRequestDetails},
+};
+#[cfg(feature = "payouts")]
+use hyperswitch_interfaces::{
+    api::{PayoutFulfill, Payouts},
+    types::PayoutFulfillType,
+};
+use masking::{ExposeInterface, Mask, Maskable, PeekInterface};
 use ring::hmac;
 #[cfg(feature = "payouts")]
 use router_env::{instrument, tracing};
 
 use self::transformers as payone;
 #[cfg(feature = "payouts")]
-use crate::connector::utils::convert_amount;
+use crate::constants::headers::DATE;
 #[cfg(feature = "payouts")]
 use crate::get_formatted_date_time;
-#[cfg(feature = "payouts")]
-use crate::services;
 use crate::{
-    configs::settings,
-    connector::{
-        utils as connector_utils,
-        utils::{ConnectorErrorType, ConnectorErrorTypeMapping},
-    },
-    consts,
-    core::errors::{self, CustomResult},
-    events::connector_api_logs::ConnectorEvent,
-    headers,
-    services::{
-        request::{self, Mask},
-        ConnectorIntegration, ConnectorSpecifications, ConnectorValidation,
+    constants::headers::AUTHORIZATION,
+    utils::{
+        get_error_code_error_message_based_on_priority, ConnectorErrorType,
+        ConnectorErrorTypeMapping,
     },
-    types::{
-        self,
-        api::{self, ConnectorCommon, ConnectorCommonExt},
-        ErrorResponse, Response,
-    },
-    utils::BytesExt,
 };
+#[cfg(feature = "payouts")]
+use crate::{types::ResponseRouterData, utils::convert_amount};
 #[derive(Clone)]
 pub struct Payone {
     #[cfg(feature = "payouts")]
@@ -59,7 +88,7 @@ impl Payone {
         canonicalized_path: String,
         content_type: String,
         date_header: String,
-    ) -> CustomResult<String, errors::ConnectorError> {
+    ) -> CustomResult<String, ConnectorError> {
         let payone::PayoneAuthType {
             api_key,
             api_secret,
@@ -73,32 +102,28 @@ impl Payone {
             canonicalized_path.trim()
         );
         let key = hmac::Key::new(hmac::HMAC_SHA256, api_secret.expose().as_bytes());
-        let hash_hmac = consts::BASE64_ENGINE.encode(hmac::sign(&key, string_to_hash.as_bytes()));
+        let hash_hmac = BASE64_ENGINE.encode(hmac::sign(&key, string_to_hash.as_bytes()));
         let signature_header = format!("GCS v1HMAC:{}:{}", api_key.peek(), hash_hmac);
 
         Ok(signature_header)
     }
 }
 
-impl api::Payment for Payone {}
-impl api::PaymentSession for Payone {}
-impl api::ConnectorAccessToken for Payone {}
-impl api::MandateSetup for Payone {}
-impl api::PaymentAuthorize for Payone {}
-impl api::PaymentSync for Payone {}
-impl api::PaymentCapture for Payone {}
-impl api::PaymentVoid for Payone {}
-impl api::Refund for Payone {}
-impl api::RefundExecute for Payone {}
-impl api::RefundSync for Payone {}
-impl api::PaymentToken for Payone {}
-
-impl
-    ConnectorIntegration<
-        api::PaymentMethodToken,
-        types::PaymentMethodTokenizationData,
-        types::PaymentsResponseData,
-    > for Payone
+impl Payment for Payone {}
+impl PaymentSession for Payone {}
+impl ConnectorAccessToken for Payone {}
+impl MandateSetup for Payone {}
+impl PaymentAuthorize for Payone {}
+impl PaymentSync for Payone {}
+impl PaymentCapture for Payone {}
+impl PaymentVoid for Payone {}
+impl Refund for Payone {}
+impl RefundExecute for Payone {}
+impl RefundSync for Payone {}
+impl PaymentToken for Payone {}
+
+impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
+    for Payone
 {
 }
 
@@ -109,9 +134,9 @@ where
     #[cfg(feature = "payouts")]
     fn build_headers(
         &self,
-        req: &types::RouterData<Flow, Request, Response>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &RouterData<Flow, Request, Response>,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         let auth = payone::PayoneAuthType::try_from(&req.connector_auth_type)?;
         let http_method = self.get_http_method().to_string();
         let content_type = Self::get_content_type(self);
@@ -129,9 +154,9 @@ where
             date_header.clone(),
         )?;
         let headers = vec![
-            (headers::DATE.to_string(), date_header.to_string().into()),
+            (DATE.to_string(), date_header.to_string().into()),
             (
-                headers::AUTHORIZATION.to_string(),
+                AUTHORIZATION.to_string(),
                 authorization_header.to_string().into(),
             ),
         ];
@@ -145,26 +170,26 @@ impl ConnectorCommon for Payone {
         "payone"
     }
 
-    fn get_currency_unit(&self) -> api::CurrencyUnit {
-        api::CurrencyUnit::Minor
+    fn get_currency_unit(&self) -> CurrencyUnit {
+        CurrencyUnit::Minor
     }
 
     fn common_get_content_type(&self) -> &'static str {
         "application/json"
     }
 
-    fn base_url<'a>(&self, connectors: &'a settings::Connectors) -> &'a str {
+    fn base_url<'a>(&self, connectors: &'a Connectors) -> &'a str {
         connectors.payone.base_url.as_ref()
     }
 
     fn get_auth_header(
         &self,
-        auth_type: &types::ConnectorAuthType,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        auth_type: &ConnectorAuthType,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         let auth = payone::PayoneAuthType::try_from(auth_type)
-            .change_context(errors::ConnectorError::FailedToObtainAuthType)?;
+            .change_context(ConnectorError::FailedToObtainAuthType)?;
         Ok(vec![(
-            headers::AUTHORIZATION.to_string(),
+            AUTHORIZATION.to_string(),
             auth.api_key.expose().into_masked(),
         )])
     }
@@ -173,34 +198,33 @@ impl ConnectorCommon for Payone {
         &self,
         res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         let response: payone::ErrorResponse = res
             .response
             .parse_struct("ErrorResponse")
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
 
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
         let errors_list = response.errors.clone().unwrap_or_default();
-        let option_error_code_message =
-            connector_utils::get_error_code_error_message_based_on_priority(
-                self.clone(),
-                errors_list
-                    .into_iter()
-                    .map(|errors| errors.into())
-                    .collect(),
-            );
+        let option_error_code_message = get_error_code_error_message_based_on_priority(
+            self.clone(),
+            errors_list
+                .into_iter()
+                .map(|errors| errors.into())
+                .collect(),
+        );
         match response.errors {
             Some(errors) => Ok(ErrorResponse {
                 status_code: res.status_code,
                 code: option_error_code_message
                     .clone()
                     .map(|error_code_message| error_code_message.error_code)
-                    .unwrap_or(consts::NO_ERROR_CODE.to_string()),
+                    .unwrap_or(NO_ERROR_CODE.to_string()),
                 message: option_error_code_message
                     .clone()
                     .map(|error_code_message| error_code_message.error_code)
-                    .unwrap_or(consts::NO_ERROR_CODE.to_string()),
+                    .unwrap_or(NO_ERROR_CODE.to_string()),
                 reason: Some(
                     errors
                         .iter()
@@ -216,8 +240,8 @@ impl ConnectorCommon for Payone {
             }),
             None => Ok(ErrorResponse {
                 status_code: res.status_code,
-                code: consts::NO_ERROR_CODE.to_string(),
-                message: consts::NO_ERROR_MESSAGE.to_string(),
+                code: NO_ERROR_CODE.to_string(),
+                message: NO_ERROR_MESSAGE.to_string(),
                 reason: None,
                 attempt_status: None,
                 connector_transaction_id: None,
@@ -230,64 +254,38 @@ impl ConnectorCommon for Payone {
 }
 impl ConnectorValidation for Payone {}
 
-impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData>
-    for Payone
-{
-}
+impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Payone {}
 
-impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken>
-    for Payone
-{
-}
+impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Payone {}
 
-impl
-    ConnectorIntegration<
-        api::SetupMandate,
-        types::SetupMandateRequestData,
-        types::PaymentsResponseData,
-    > for Payone
-{
-}
+impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Payone {}
 
-impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData>
-    for Payone
-{
-}
+impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Payone {}
 
-impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData>
-    for Payone
-{
-}
+impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Payone {}
 
-impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData>
-    for Payone
-{
-}
+impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Payone {}
 
-impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData>
-    for Payone
-{
-}
+impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Payone {}
 
-impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Payone {}
+impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Payone {}
 
-impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for Payone {}
-impl api::Payouts for Payone {}
+impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Payone {}
+#[cfg(feature = "payouts")]
+impl Payouts for Payone {}
 
 #[cfg(feature = "payouts")]
-impl api::PayoutFulfill for Payone {}
+impl PayoutFulfill for Payone {}
 
 #[cfg(feature = "payouts")]
-impl ConnectorIntegration<api::PoFulfill, types::PayoutsData, types::PayoutsResponseData>
-    for Payone
-{
+impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Payone {
     fn get_url(
         &self,
-        req: &types::PayoutsRouterData<api::PoFulfill>,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        req: &PayoutsRouterData<PoFulfill>,
+        _connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         let auth = payone::PayoneAuthType::try_from(&req.connector_auth_type)
-            .change_context(errors::ConnectorError::FailedToObtainAuthType)?;
+            .change_context(ConnectorError::FailedToObtainAuthType)?;
         Ok(format!(
             "{}v2/{}/payouts",
             self.base_url(_connectors),
@@ -297,17 +295,17 @@ impl ConnectorIntegration<api::PoFulfill, types::PayoutsData, types::PayoutsResp
 
     fn get_headers(
         &self,
-        req: &types::PayoutsRouterData<api::PoFulfill>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &PayoutsRouterData<PoFulfill>,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
     fn get_request_body(
         &self,
-        req: &types::PayoutsRouterData<api::PoFulfill>,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        req: &PayoutsRouterData<PoFulfill>,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
         let amount = convert_amount(
             self.amount_converter,
             req.request.minor_amount,
@@ -320,19 +318,15 @@ impl ConnectorIntegration<api::PoFulfill, types::PayoutsData, types::PayoutsResp
 
     fn build_request(
         &self,
-        req: &types::PayoutsRouterData<api::PoFulfill>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
-        let request = services::RequestBuilder::new()
-            .method(services::Method::Post)
-            .url(&types::PayoutFulfillType::get_url(self, req, connectors)?)
+        req: &PayoutsRouterData<PoFulfill>,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
+        let request = RequestBuilder::new()
+            .method(Method::Post)
+            .url(&PayoutFulfillType::get_url(self, req, connectors)?)
             .attach_default_headers()
-            .headers(types::PayoutFulfillType::get_headers(
-                self, req, connectors,
-            )?)
-            .set_body(types::PayoutFulfillType::get_request_body(
-                self, req, connectors,
-            )?)
+            .headers(PayoutFulfillType::get_headers(self, req, connectors)?)
+            .set_body(PayoutFulfillType::get_request_body(self, req, connectors)?)
             .build();
         Ok(Some(request))
     }
@@ -340,19 +334,19 @@ impl ConnectorIntegration<api::PoFulfill, types::PayoutsData, types::PayoutsResp
     #[instrument(skip_all)]
     fn handle_response(
         &self,
-        data: &types::PayoutsRouterData<api::PoFulfill>,
+        data: &PayoutsRouterData<PoFulfill>,
         event_builder: Option<&mut ConnectorEvent>,
         res: Response,
-    ) -> CustomResult<types::PayoutsRouterData<api::PoFulfill>, errors::ConnectorError> {
+    ) -> CustomResult<PayoutsRouterData<PoFulfill>, ConnectorError> {
         let response: payone::PayonePayoutFulfillResponse = res
             .response
             .parse_struct("PayonePayoutFulfillResponse")
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
 
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
 
-        types::RouterData::try_from(types::ResponseRouterData {
+        RouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -363,32 +357,32 @@ impl ConnectorIntegration<api::PoFulfill, types::PayoutsData, types::PayoutsResp
         &self,
         res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
 #[async_trait::async_trait]
-impl api::IncomingWebhook for Payone {
+impl IncomingWebhook for Payone {
     fn get_webhook_object_reference_id(
         &self,
-        _request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<api::webhooks::ObjectReferenceId, errors::ConnectorError> {
-        Err(report!(errors::ConnectorError::WebhooksNotImplemented))
+        _request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<ObjectReferenceId, ConnectorError> {
+        Err(report!(ConnectorError::WebhooksNotImplemented))
     }
 
     fn get_webhook_event_type(
         &self,
-        _request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> {
-        Err(report!(errors::ConnectorError::WebhooksNotImplemented))
+        _request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<IncomingWebhookEvent, ConnectorError> {
+        Err(report!(ConnectorError::WebhooksNotImplemented))
     }
 
     fn get_webhook_resource_object(
         &self,
-        _request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
-        Err(report!(errors::ConnectorError::WebhooksNotImplemented))
+        _request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
+        Err(report!(ConnectorError::WebhooksNotImplemented))
     }
 }
 
diff --git a/crates/router/src/connector/payone/transformers.rs b/crates/hyperswitch_connectors/src/connectors/payone/transformers.rs
similarity index 61%
rename from crates/router/src/connector/payone/transformers.rs
rename to crates/hyperswitch_connectors/src/connectors/payone/transformers.rs
index 2ac9c083018..8beae986e3a 100644
--- a/crates/router/src/connector/payone/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/payone/transformers.rs
@@ -2,31 +2,36 @@
 use api_models::payouts::PayoutMethodData;
 #[cfg(feature = "payouts")]
 use cards::CardNumber;
+#[cfg(feature = "payouts")]
+use common_enums::{PayoutStatus, PayoutType};
 use common_utils::types::MinorUnit;
 #[cfg(feature = "payouts")]
+use common_utils::{ext_traits::OptionExt, transformers::ForeignFrom};
+#[cfg(feature = "payouts")]
 use error_stack::ResultExt;
+use hyperswitch_domain_models::router_data::ConnectorAuthType;
+#[cfg(feature = "payouts")]
+use hyperswitch_domain_models::{
+    router_flow_types::PoFulfill,
+    types::{PayoutsResponseData, PayoutsRouterData},
+};
+use hyperswitch_interfaces::errors::ConnectorError;
 use masking::Secret;
 use serde::{Deserialize, Serialize};
-use serde_repr::{Deserialize_repr, Serialize_repr};
-
-use crate::connector::{
-    utils,
-    utils::{get_unimplemented_payment_method_error_message, CardIssuer},
-};
 
 #[cfg(feature = "payouts")]
-type Error = error_stack::Report<errors::ConnectorError>;
-
+use crate::utils::CardData as _;
+use crate::utils::{
+    get_unimplemented_payment_method_error_message, CardIssuer, ErrorCodeAndMessage,
+};
 #[cfg(feature = "payouts")]
 use crate::{
-    connector::utils::{CardData, PayoutsData, RouterData},
-    core::errors,
-    types::{self, api, storage::enums as storage_enums, transformers::ForeignFrom},
-    utils::OptionExt,
+    types::PayoutsResponseRouterData,
+    utils::{PayoutsData, RouterData},
 };
-#[cfg(not(feature = "payouts"))]
-use crate::{core::errors, types};
-
+#[cfg(feature = "payouts")]
+type Error = error_stack::Report<ConnectorError>;
+use serde_repr::{Deserialize_repr, Serialize_repr};
 pub struct PayoneRouterData<T> {
     pub amount: MinorUnit,
     pub router_data: T,
@@ -54,7 +59,7 @@ pub struct SubError {
     pub http_status_code: u16,
 }
 
-impl From<SubError> for utils::ErrorCodeAndMessage {
+impl From<SubError> for ErrorCodeAndMessage {
     fn from(error: SubError) -> Self {
         Self {
             error_code: error.code.to_string(),
@@ -69,11 +74,11 @@ pub struct PayoneAuthType {
     pub api_secret: Secret<String>,
 }
 
-impl TryFrom<&types::ConnectorAuthType> for PayoneAuthType {
-    type Error = error_stack::Report<errors::ConnectorError>;
-    fn try_from(auth_type: &types::ConnectorAuthType) -> Result<Self, Self::Error> {
+impl TryFrom<&ConnectorAuthType> for PayoneAuthType {
+    type Error = error_stack::Report<ConnectorError>;
+    fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> {
         match auth_type {
-            types::ConnectorAuthType::SignatureKey {
+            ConnectorAuthType::SignatureKey {
                 api_key,
                 key1,
                 api_secret,
@@ -82,7 +87,7 @@ impl TryFrom<&types::ConnectorAuthType> for PayoneAuthType {
                 merchant_account: key1.to_owned(),
                 api_secret: api_secret.to_owned(),
             }),
-            _ => Err(errors::ConnectorError::FailedToObtainAuthType)?,
+            _ => Err(ConnectorError::FailedToObtainAuthType)?,
         }
     }
 }
@@ -121,60 +126,54 @@ pub struct Card {
 }
 
 #[cfg(feature = "payouts")]
-impl TryFrom<PayoneRouterData<&types::PayoutsRouterData<api::PoFulfill>>>
-    for PayonePayoutFulfillRequest
-{
+impl TryFrom<PayoneRouterData<&PayoutsRouterData<PoFulfill>>> for PayonePayoutFulfillRequest {
     type Error = Error;
     fn try_from(
-        item: PayoneRouterData<&types::PayoutsRouterData<api::PoFulfill>>,
+        item: PayoneRouterData<&PayoutsRouterData<PoFulfill>>,
     ) -> Result<Self, Self::Error> {
         let request = item.router_data.request.to_owned();
         let payout_type = request.get_payout_type()?;
         match payout_type {
-            storage_enums::PayoutType::Card => {
+            PayoutType::Card => {
                 let amount_of_money: AmountOfMoney = AmountOfMoney {
                     amount: item.amount,
                     currency_code: item.router_data.request.destination_currency.to_string(),
                 };
-                let card_payout_method_specific_input = match item
-                    .router_data
-                    .get_payout_method_data()?
-                {
-                    PayoutMethodData::Card(card_data) => CardPayoutMethodSpecificInput {
-                        card: Card {
-                            card_number: card_data.card_number.clone(),
-                            card_holder_name: card_data
-                                .card_holder_name
-                                .clone()
-                                .get_required_value("card_holder_name")
-                                .change_context(errors::ConnectorError::MissingRequiredField {
-                                    field_name: "payout_method_data.card.holder_name",
-                                })?,
-                            expiry_date: card_data
-                                .get_card_expiry_month_year_2_digit_with_delimiter(
-                                    "".to_string(),
-                                )?,
+                let card_payout_method_specific_input =
+                    match item.router_data.get_payout_method_data()? {
+                        PayoutMethodData::Card(card_data) => CardPayoutMethodSpecificInput {
+                            card: Card {
+                                card_number: card_data.card_number.clone(),
+                                card_holder_name: card_data
+                                    .card_holder_name
+                                    .clone()
+                                    .get_required_value("card_holder_name")
+                                    .change_context(ConnectorError::MissingRequiredField {
+                                        field_name: "payout_method_data.card.holder_name",
+                                    })?,
+                                expiry_date: card_data
+                                    .get_card_expiry_month_year_2_digit_with_delimiter(
+                                        "".to_string(),
+                                    )?,
+                            },
+                            payment_product_id: PaymentProductId::try_from(
+                                card_data.get_card_issuer()?,
+                            )?,
                         },
-                        payment_product_id: PaymentProductId::try_from(
-                            card_data.get_card_issuer()?,
-                        )?,
-                    },
-                    PayoutMethodData::Bank(_) | PayoutMethodData::Wallet(_) => {
-                        Err(errors::ConnectorError::NotImplemented(
-                            get_unimplemented_payment_method_error_message("Payone"),
-                        ))?
-                    }
-                };
+                        PayoutMethodData::Bank(_) | PayoutMethodData::Wallet(_) => {
+                            Err(ConnectorError::NotImplemented(
+                                get_unimplemented_payment_method_error_message("Payone"),
+                            ))?
+                        }
+                    };
                 Ok(Self {
                     amount_of_money,
                     card_payout_method_specific_input,
                 })
             }
-            storage_enums::PayoutType::Wallet | storage_enums::PayoutType::Bank => {
-                Err(errors::ConnectorError::NotImplemented(
-                    get_unimplemented_payment_method_error_message("Payone"),
-                ))?
-            }
+            PayoutType::Wallet | PayoutType::Bank => Err(ConnectorError::NotImplemented(
+                get_unimplemented_payment_method_error_message("Payone"),
+            ))?,
         }
     }
 }
@@ -187,7 +186,7 @@ pub enum PaymentProductId {
 }
 
 impl TryFrom<CardIssuer> for PaymentProductId {
-    type Error = error_stack::Report<errors::ConnectorError>;
+    type Error = error_stack::Report<ConnectorError>;
     fn try_from(issuer: CardIssuer) -> Result<Self, Self::Error> {
         match issuer {
             CardIssuer::Master => Ok(Self::MasterCard),
@@ -197,7 +196,7 @@ impl TryFrom<CardIssuer> for PaymentProductId {
             | CardIssuer::Discover
             | CardIssuer::DinersClub
             | CardIssuer::JCB
-            | CardIssuer::CarteBlanche => Err(errors::ConnectorError::NotImplemented(
+            | CardIssuer::CarteBlanche => Err(ConnectorError::NotImplemented(
                 get_unimplemented_payment_method_error_message("payone"),
             )
             .into()),
@@ -237,7 +236,7 @@ pub struct PayoutOutput {
 }
 
 #[cfg(feature = "payouts")]
-impl ForeignFrom<PayoneStatus> for storage_enums::PayoutStatus {
+impl ForeignFrom<PayoneStatus> for PayoutStatus {
     fn foreign_from(payone_status: PayoneStatus) -> Self {
         match payone_status {
             PayoneStatus::AccountCredited => Self::Success,
@@ -251,18 +250,18 @@ impl ForeignFrom<PayoneStatus> for storage_enums::PayoutStatus {
 }
 
 #[cfg(feature = "payouts")]
-impl<F> TryFrom<types::PayoutsResponseRouterData<F, PayonePayoutFulfillResponse>>
-    for types::PayoutsRouterData<F>
+impl<F> TryFrom<PayoutsResponseRouterData<F, PayonePayoutFulfillResponse>>
+    for PayoutsRouterData<F>
 {
     type Error = Error;
     fn try_from(
-        item: types::PayoutsResponseRouterData<F, PayonePayoutFulfillResponse>,
+        item: PayoutsResponseRouterData<F, PayonePayoutFulfillResponse>,
     ) -> Result<Self, Self::Error> {
         let response: PayonePayoutFulfillResponse = item.response;
 
         Ok(Self {
-            response: Ok(types::PayoutsResponseData {
-                status: Some(storage_enums::PayoutStatus::foreign_from(response.status)),
+            response: Ok(PayoutsResponseData {
+                status: Some(PayoutStatus::foreign_from(response.status)),
                 connector_payout_id: Some(response.id),
                 payout_eligible: None,
                 should_add_next_step_to_process_tracker: false,
diff --git a/crates/router/src/connector/riskified.rs b/crates/hyperswitch_connectors/src/connectors/riskified.rs
similarity index 51%
rename from crates/router/src/connector/riskified.rs
rename to crates/hyperswitch_connectors/src/connectors/riskified.rs
index 971bd5de04f..269ac0700c4 100644
--- a/crates/router/src/connector/riskified.rs
+++ b/crates/hyperswitch_connectors/src/connectors/riskified.rs
@@ -1,51 +1,96 @@
 pub mod transformers;
-
+#[cfg(feature = "frm")]
+use api_models::webhooks::{ConnectorWebhookSecrets, IncomingWebhookEvent, ObjectReferenceId};
 #[cfg(feature = "frm")]
 use base64::Engine;
-use common_utils::types::{
-    AmountConvertor, MinorUnit, StringMajorUnit, StringMajorUnitForConnector,
+#[cfg(feature = "frm")]
+use common_utils::types::{AmountConvertor, StringMajorUnit, StringMajorUnitForConnector};
+#[cfg(feature = "frm")]
+use common_utils::{
+    consts::BASE64_ENGINE,
+    request::{Method, RequestBuilder},
+    types::MinorUnit,
 };
 #[cfg(feature = "frm")]
 use common_utils::{crypto, ext_traits::ByteSliceExt, request::RequestContent};
+use common_utils::{errors::CustomResult, request::Request};
 #[cfg(feature = "frm")]
 use error_stack::ResultExt;
 #[cfg(feature = "frm")]
-use masking::{ExposeInterface, PeekInterface, Secret};
+use hyperswitch_domain_models::{
+    router_data::ErrorResponse,
+    router_flow_types::{Checkout, Fulfillment, RecordReturn, Sale, Transaction},
+    router_request_types::fraud_check::{
+        FraudCheckCheckoutData, FraudCheckFulfillmentData, FraudCheckRecordReturnData,
+        FraudCheckSaleData, FraudCheckTransactionData,
+    },
+    router_response_types::fraud_check::FraudCheckResponseData,
+};
+use hyperswitch_domain_models::{
+    router_data::{AccessToken, RouterData},
+    router_flow_types::{
+        AccessTokenAuth, Authorize, Capture, Execute, PSync, PaymentMethodToken, RSync, Session,
+        SetupMandate, Void,
+    },
+    router_request_types::{
+        AccessTokenRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData,
+        PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
+        RefundsData, SetupMandateRequestData,
+    },
+    router_response_types::{PaymentsResponseData, RefundsResponseData},
+};
+use hyperswitch_interfaces::{
+    api::{
+        ConnectorAccessToken, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration,
+        ConnectorSpecifications, ConnectorValidation, MandateSetup, Payment, PaymentAuthorize,
+        PaymentCapture, PaymentSession, PaymentSync, PaymentToken, PaymentVoid, Refund,
+        RefundExecute, RefundSync,
+    },
+    configs::Connectors,
+    errors::ConnectorError,
+};
+#[cfg(feature = "frm")]
+use hyperswitch_interfaces::{
+    api::{
+        FraudCheck, FraudCheckCheckout, FraudCheckFulfillment, FraudCheckRecordReturn,
+        FraudCheckSale, FraudCheckTransaction,
+    },
+    events::connector_api_logs::ConnectorEvent,
+    types::Response,
+    webhooks::{IncomingWebhook, IncomingWebhookRequestDetails},
+};
+#[cfg(feature = "frm")]
+use masking::Maskable;
+#[cfg(feature = "frm")]
+use masking::{ExposeInterface, Mask, PeekInterface, Secret};
 #[cfg(feature = "frm")]
 use ring::hmac;
 #[cfg(feature = "frm")]
 use transformers as riskified;
 
-use super::utils::convert_amount;
 #[cfg(feature = "frm")]
-use super::utils::{self as connector_utils, FrmTransactionRouterDataRequest};
+use crate::constants::headers;
+#[cfg(feature = "frm")]
+use crate::utils::convert_amount;
+#[cfg(feature = "frm")]
 use crate::{
-    configs::settings,
-    core::errors::{self, CustomResult},
-    services::{self, ConnectorIntegration, ConnectorSpecifications, ConnectorValidation},
     types::{
-        self,
-        api::{self, ConnectorCommon, ConnectorCommonExt},
+        FrmCheckoutRouterData, FrmCheckoutType, FrmFulfillmentRouterData, FrmFulfillmentType,
+        FrmTransactionRouterData, FrmTransactionType, ResponseRouterData,
     },
-};
-#[cfg(feature = "frm")]
-use crate::{
-    consts,
-    events::connector_api_logs::ConnectorEvent,
-    headers,
-    services::request,
-    types::{api::fraud_check as frm_api, fraud_check as frm_types, ErrorResponse, Response},
-    utils::BytesExt,
+    utils::FrmTransactionRouterDataRequest,
 };
 
 #[derive(Clone)]
 pub struct Riskified {
+    #[cfg(feature = "frm")]
     amount_converter: &'static (dyn AmountConvertor<Output = StringMajorUnit> + Sync),
 }
 
 impl Riskified {
     pub fn new() -> &'static Self {
         &Self {
+            #[cfg(feature = "frm")]
             amount_converter: &StringMajorUnitForConnector,
         }
     }
@@ -55,7 +100,7 @@ impl Riskified {
         &self,
         auth: &riskified::RiskifiedAuthType,
         payload: &str,
-    ) -> CustomResult<String, errors::ConnectorError> {
+    ) -> CustomResult<String, ConnectorError> {
         let key = hmac::Key::new(
             hmac::HMAC_SHA256,
             auth.secret_token.clone().expose().as_bytes(),
@@ -76,9 +121,9 @@ where
     #[cfg(feature = "frm")]
     fn build_headers(
         &self,
-        req: &types::RouterData<Flow, Request, Response>,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &RouterData<Flow, Request, Response>,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         let auth: riskified::RiskifiedAuthType =
             riskified::RiskifiedAuthType::try_from(&req.connector_auth_type)?;
 
@@ -89,7 +134,7 @@ where
 
         let digest = self
             .generate_authorization_signature(&auth, payload)
-            .change_context(errors::ConnectorError::RequestEncodingFailed)?;
+            .change_context(ConnectorError::RequestEncodingFailed)?;
 
         let header = vec![
             (
@@ -102,7 +147,7 @@ where
             ),
             (
                 "X-RISKIFIED-HMAC-SHA256".to_string(),
-                request::Mask::into_masked(digest),
+                Mask::into_masked(digest),
             ),
             (
                 "Accept".to_string(),
@@ -122,7 +167,7 @@ impl ConnectorCommon for Riskified {
     fn common_get_content_type(&self) -> &'static str {
         "application/json"
     }
-    fn base_url<'a>(&self, connectors: &'a settings::Connectors) -> &'a str {
+    fn base_url<'a>(&self, connectors: &'a Connectors) -> &'a str {
         connectors.riskified.base_url.as_ref()
     }
 
@@ -131,11 +176,13 @@ impl ConnectorCommon for Riskified {
         &self,
         res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
+        use hyperswitch_interfaces::consts::NO_ERROR_CODE;
+
         let response: riskified::ErrorResponse = res
             .response
             .parse_struct("ErrorResponse")
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
 
         event_builder.map(|i| i.set_error_response_body(&response));
         router_env::logger::info!(connector_response=?response);
@@ -143,7 +190,7 @@ impl ConnectorCommon for Riskified {
         Ok(ErrorResponse {
             status_code: res.status_code,
             attempt_status: None,
-            code: consts::NO_ERROR_CODE.to_string(),
+            code: NO_ERROR_CODE.to_string(),
             message: response.error.message.clone(),
             reason: None,
             connector_transaction_id: None,
@@ -155,18 +202,12 @@ impl ConnectorCommon for Riskified {
 }
 
 #[cfg(feature = "frm")]
-impl
-    ConnectorIntegration<
-        frm_api::Checkout,
-        frm_types::FraudCheckCheckoutData,
-        frm_types::FraudCheckResponseData,
-    > for Riskified
-{
+impl ConnectorIntegration<Checkout, FraudCheckCheckoutData, FraudCheckResponseData> for Riskified {
     fn get_headers(
         &self,
-        req: &frm_types::FrmCheckoutRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &FrmCheckoutRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
@@ -176,23 +217,23 @@ impl
 
     fn get_url(
         &self,
-        _req: &frm_types::FrmCheckoutRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &FrmCheckoutRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}{}", self.base_url(connectors), "/decide"))
     }
 
     fn get_request_body(
         &self,
-        req: &frm_types::FrmCheckoutRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        req: &FrmCheckoutRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
         let amount = convert_amount(
             self.amount_converter,
             MinorUnit::new(req.request.amount),
             req.request
                 .currency
-                .ok_or(errors::ConnectorError::MissingRequiredField {
+                .ok_or(ConnectorError::MissingRequiredField {
                     field_name: "currency",
                 })?,
         )?;
@@ -203,37 +244,33 @@ impl
 
     fn build_request(
         &self,
-        req: &frm_types::FrmCheckoutRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &FrmCheckoutRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&frm_types::FrmCheckoutType::get_url(self, req, connectors)?)
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&FrmCheckoutType::get_url(self, req, connectors)?)
                 .attach_default_headers()
-                .headers(frm_types::FrmCheckoutType::get_headers(
-                    self, req, connectors,
-                )?)
-                .set_body(frm_types::FrmCheckoutType::get_request_body(
-                    self, req, connectors,
-                )?)
+                .headers(FrmCheckoutType::get_headers(self, req, connectors)?)
+                .set_body(FrmCheckoutType::get_request_body(self, req, connectors)?)
                 .build(),
         ))
     }
 
     fn handle_response(
         &self,
-        data: &frm_types::FrmCheckoutRouterData,
+        data: &FrmCheckoutRouterData,
         event_builder: Option<&mut ConnectorEvent>,
         res: Response,
-    ) -> CustomResult<frm_types::FrmCheckoutRouterData, errors::ConnectorError> {
+    ) -> CustomResult<FrmCheckoutRouterData, ConnectorError> {
         let response: riskified::RiskifiedPaymentsResponse = res
             .response
             .parse_struct("RiskifiedPaymentsResponse Checkout")
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
-        <frm_types::FrmCheckoutRouterData>::try_from(types::ResponseRouterData {
+        <FrmCheckoutRouterData>::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -243,47 +280,36 @@ impl
         &self,
         res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
-impl api::Payment for Riskified {}
-impl api::PaymentAuthorize for Riskified {}
-impl api::PaymentSync for Riskified {}
-impl api::PaymentVoid for Riskified {}
-impl api::PaymentCapture for Riskified {}
-impl api::MandateSetup for Riskified {}
-impl api::ConnectorAccessToken for Riskified {}
-impl api::PaymentToken for Riskified {}
-impl api::Refund for Riskified {}
-impl api::RefundExecute for Riskified {}
-impl api::RefundSync for Riskified {}
+impl Payment for Riskified {}
+impl PaymentAuthorize for Riskified {}
+impl PaymentSync for Riskified {}
+impl PaymentVoid for Riskified {}
+impl PaymentCapture for Riskified {}
+impl MandateSetup for Riskified {}
+impl ConnectorAccessToken for Riskified {}
+impl PaymentToken for Riskified {}
+impl Refund for Riskified {}
+impl RefundExecute for Riskified {}
+impl RefundSync for Riskified {}
 impl ConnectorValidation for Riskified {}
 
 #[cfg(feature = "frm")]
-impl
-    ConnectorIntegration<
-        frm_api::Sale,
-        frm_types::FraudCheckSaleData,
-        frm_types::FraudCheckResponseData,
-    > for Riskified
-{
-}
+impl ConnectorIntegration<Sale, FraudCheckSaleData, FraudCheckResponseData> for Riskified {}
 
 #[cfg(feature = "frm")]
-impl
-    ConnectorIntegration<
-        frm_api::Transaction,
-        frm_types::FraudCheckTransactionData,
-        frm_types::FraudCheckResponseData,
-    > for Riskified
+impl ConnectorIntegration<Transaction, FraudCheckTransactionData, FraudCheckResponseData>
+    for Riskified
 {
     fn get_headers(
         &self,
-        req: &frm_types::FrmTransactionRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &FrmTransactionRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
@@ -293,9 +319,9 @@ impl
 
     fn get_url(
         &self,
-        req: &frm_types::FrmTransactionRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        req: &FrmTransactionRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         match req.is_payment_successful() {
             Some(false) => Ok(format!(
                 "{}{}",
@@ -308,9 +334,9 @@ impl
 
     fn get_request_body(
         &self,
-        req: &frm_types::FrmTransactionRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        req: &FrmTransactionRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
         match req.is_payment_successful() {
             Some(false) => {
                 let req_obj = riskified::TransactionFailedRequest::try_from(req)?;
@@ -322,7 +348,7 @@ impl
                     MinorUnit::new(req.request.amount),
                     req.request
                         .currency
-                        .ok_or(errors::ConnectorError::MissingRequiredField {
+                        .ok_or(ConnectorError::MissingRequiredField {
                             field_name: "currency",
                         })?,
                 )?;
@@ -335,50 +361,44 @@ impl
 
     fn build_request(
         &self,
-        req: &frm_types::FrmTransactionRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &FrmTransactionRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&frm_types::FrmTransactionType::get_url(
-                    self, req, connectors,
-                )?)
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&FrmTransactionType::get_url(self, req, connectors)?)
                 .attach_default_headers()
-                .headers(frm_types::FrmTransactionType::get_headers(
-                    self, req, connectors,
-                )?)
-                .set_body(frm_types::FrmTransactionType::get_request_body(
-                    self, req, connectors,
-                )?)
+                .headers(FrmTransactionType::get_headers(self, req, connectors)?)
+                .set_body(FrmTransactionType::get_request_body(self, req, connectors)?)
                 .build(),
         ))
     }
 
     fn handle_response(
         &self,
-        data: &frm_types::FrmTransactionRouterData,
+        data: &FrmTransactionRouterData,
         event_builder: Option<&mut ConnectorEvent>,
         res: Response,
-    ) -> CustomResult<frm_types::FrmTransactionRouterData, errors::ConnectorError> {
+    ) -> CustomResult<FrmTransactionRouterData, ConnectorError> {
         let response: riskified::RiskifiedTransactionResponse = res
             .response
             .parse_struct("RiskifiedPaymentsResponse Transaction")
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
 
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
 
         match response {
             riskified::RiskifiedTransactionResponse::FailedResponse(response_data) => {
-                <frm_types::FrmTransactionRouterData>::try_from(types::ResponseRouterData {
+                <FrmTransactionRouterData>::try_from(ResponseRouterData {
                     response: response_data,
                     data: data.clone(),
                     http_code: res.status_code,
                 })
             }
             riskified::RiskifiedTransactionResponse::SuccessResponse(response_data) => {
-                <frm_types::FrmTransactionRouterData>::try_from(types::ResponseRouterData {
+                <FrmTransactionRouterData>::try_from(ResponseRouterData {
                     response: response_data,
                     data: data.clone(),
                     http_code: res.status_code,
@@ -390,24 +410,20 @@ impl
         &self,
         res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
 #[cfg(feature = "frm")]
-impl
-    ConnectorIntegration<
-        frm_api::Fulfillment,
-        frm_types::FraudCheckFulfillmentData,
-        frm_types::FraudCheckResponseData,
-    > for Riskified
+impl ConnectorIntegration<Fulfillment, FraudCheckFulfillmentData, FraudCheckResponseData>
+    for Riskified
 {
     fn get_headers(
         &self,
-        req: &frm_types::FrmFulfillmentRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
+        req: &FrmFulfillmentRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> {
         self.build_headers(req, connectors)
     }
 
@@ -417,58 +433,52 @@ impl
 
     fn get_url(
         &self,
-        _req: &frm_types::FrmFulfillmentRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<String, errors::ConnectorError> {
+        _req: &FrmFulfillmentRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, ConnectorError> {
         Ok(format!("{}{}", self.base_url(connectors), "/fulfill"))
     }
 
     fn get_request_body(
         &self,
-        req: &frm_types::FrmFulfillmentRouterData,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        req: &FrmFulfillmentRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, ConnectorError> {
         let req_obj = riskified::RiskifiedFulfillmentRequest::try_from(req)?;
         Ok(RequestContent::Json(Box::new(req_obj)))
     }
 
     fn build_request(
         &self,
-        req: &frm_types::FrmFulfillmentRouterData,
-        connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+        req: &FrmFulfillmentRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
         Ok(Some(
-            services::RequestBuilder::new()
-                .method(services::Method::Post)
-                .url(&frm_types::FrmFulfillmentType::get_url(
-                    self, req, connectors,
-                )?)
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&FrmFulfillmentType::get_url(self, req, connectors)?)
                 .attach_default_headers()
-                .headers(frm_types::FrmFulfillmentType::get_headers(
-                    self, req, connectors,
-                )?)
-                .set_body(frm_types::FrmFulfillmentType::get_request_body(
-                    self, req, connectors,
-                )?)
+                .headers(FrmFulfillmentType::get_headers(self, req, connectors)?)
+                .set_body(FrmFulfillmentType::get_request_body(self, req, connectors)?)
                 .build(),
         ))
     }
 
     fn handle_response(
         &self,
-        data: &frm_types::FrmFulfillmentRouterData,
+        data: &FrmFulfillmentRouterData,
         event_builder: Option<&mut ConnectorEvent>,
         res: Response,
-    ) -> CustomResult<frm_types::FrmFulfillmentRouterData, errors::ConnectorError> {
+    ) -> CustomResult<FrmFulfillmentRouterData, ConnectorError> {
         let response: riskified::RiskifiedFulfilmentResponse = res
             .response
             .parse_struct("RiskifiedFulfilmentResponse fulfilment")
-            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+            .change_context(ConnectorError::ResponseDeserializationFailed)?;
 
         event_builder.map(|i| i.set_response_body(&response));
         router_env::logger::info!(connector_response=?response);
 
-        frm_types::FrmFulfillmentRouterData::try_from(types::ResponseRouterData {
+        FrmFulfillmentRouterData::try_from(ResponseRouterData {
             response,
             data: data.clone(),
             http_code: res.status_code,
@@ -479,136 +489,93 @@ impl
         &self,
         res: Response,
         event_builder: Option<&mut ConnectorEvent>,
-    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+    ) -> CustomResult<ErrorResponse, ConnectorError> {
         self.build_error_response(res, event_builder)
     }
 }
 
 #[cfg(feature = "frm")]
-impl
-    ConnectorIntegration<
-        frm_api::RecordReturn,
-        frm_types::FraudCheckRecordReturnData,
-        frm_types::FraudCheckResponseData,
-    > for Riskified
-{
-}
-
-impl
-    ConnectorIntegration<
-        api::PaymentMethodToken,
-        types::PaymentMethodTokenizationData,
-        types::PaymentsResponseData,
-    > for Riskified
+impl ConnectorIntegration<RecordReturn, FraudCheckRecordReturnData, FraudCheckResponseData>
+    for Riskified
 {
 }
 
-impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken>
+impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
     for Riskified
 {
 }
 
-impl
-    ConnectorIntegration<
-        api::SetupMandate,
-        types::SetupMandateRequestData,
-        types::PaymentsResponseData,
-    > for Riskified
+impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Riskified {}
+
+impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData>
+    for Riskified
 {
     fn build_request(
         &self,
-        _req: &types::RouterData<
-            api::SetupMandate,
-            types::SetupMandateRequestData,
-            types::PaymentsResponseData,
-        >,
-        _connectors: &settings::Connectors,
-    ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
-        Err(
-            errors::ConnectorError::NotImplemented("Setup Mandate flow for Riskified".to_string())
-                .into(),
-        )
+        _req: &RouterData<SetupMandate, SetupMandateRequestData, PaymentsResponseData>,
+        _connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, ConnectorError> {
+        Err(ConnectorError::NotImplemented("Setup Mandate flow for Riskified".to_string()).into())
     }
 }
 
-impl api::PaymentSession for Riskified {}
+impl PaymentSession for Riskified {}
 
-impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData>
-    for Riskified
-{
-}
+impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Riskified {}
 
-impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData>
-    for Riskified
-{
-}
+impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Riskified {}
 
-impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData>
-    for Riskified
-{
-}
+impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Riskified {}
 
-impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData>
-    for Riskified
-{
-}
+impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Riskified {}
 
-impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData>
-    for Riskified
-{
-}
+impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Riskified {}
 
-impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData>
-    for Riskified
-{
-}
+impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Riskified {}
 
-impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData>
-    for Riskified
-{
-}
+impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Riskified {}
 
 #[cfg(feature = "frm")]
-impl api::FraudCheck for Riskified {}
+impl FraudCheck for Riskified {}
 #[cfg(feature = "frm")]
-impl frm_api::FraudCheckSale for Riskified {}
+impl FraudCheckSale for Riskified {}
 #[cfg(feature = "frm")]
-impl frm_api::FraudCheckCheckout for Riskified {}
+impl FraudCheckCheckout for Riskified {}
 #[cfg(feature = "frm")]
-impl frm_api::FraudCheckTransaction for Riskified {}
+impl FraudCheckTransaction for Riskified {}
 #[cfg(feature = "frm")]
-impl frm_api::FraudCheckFulfillment for Riskified {}
+impl FraudCheckFulfillment for Riskified {}
 #[cfg(feature = "frm")]
-impl frm_api::FraudCheckRecordReturn for Riskified {}
+impl FraudCheckRecordReturn for Riskified {}
 
 #[cfg(feature = "frm")]
 #[async_trait::async_trait]
-impl api::IncomingWebhook for Riskified {
+impl IncomingWebhook for Riskified {
     fn get_webhook_source_verification_algorithm(
         &self,
-        _request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<Box<dyn crypto::VerifySignature + Send>, errors::ConnectorError> {
+        _request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<Box<dyn crypto::VerifySignature + Send>, ConnectorError> {
         Ok(Box::new(crypto::HmacSha256))
     }
 
     fn get_webhook_source_verification_signature(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
-        _connector_webhook_secrets: &api_models::webhooks::ConnectorWebhookSecrets,
-    ) -> CustomResult<Vec<u8>, errors::ConnectorError> {
+        request: &IncomingWebhookRequestDetails<'_>,
+        _connector_webhook_secrets: &ConnectorWebhookSecrets,
+    ) -> CustomResult<Vec<u8>, ConnectorError> {
         let header_value =
-            connector_utils::get_header_key_value("x-riskified-hmac-sha256", request.headers)?;
+            crate::utils::get_header_key_value("x-riskified-hmac-sha256", request.headers)?;
         Ok(header_value.as_bytes().to_vec())
     }
 
     async fn verify_webhook_source(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
+        request: &IncomingWebhookRequestDetails<'_>,
         merchant_id: &common_utils::id_type::MerchantId,
         connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
         _connector_account_details: crypto::Encryptable<Secret<serde_json::Value>>,
         connector_label: &str,
-    ) -> CustomResult<bool, errors::ConnectorError> {
+    ) -> CustomResult<bool, ConnectorError> {
         let connector_webhook_secrets = self
             .get_webhook_source_verification_merchant_secret(
                 merchant_id,
@@ -616,11 +583,11 @@ impl api::IncomingWebhook for Riskified {
                 connector_webhook_details,
             )
             .await
-            .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?;
+            .change_context(ConnectorError::WebhookSourceVerificationFailed)?;
 
         let signature = self
             .get_webhook_source_verification_signature(request, &connector_webhook_secrets)
-            .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?;
+            .change_context(ConnectorError::WebhookSourceVerificationFailed)?;
 
         let message = self
             .get_webhook_source_verification_message(
@@ -628,55 +595,55 @@ impl api::IncomingWebhook for Riskified {
                 merchant_id,
                 &connector_webhook_secrets,
             )
-            .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?;
+            .change_context(ConnectorError::WebhookSourceVerificationFailed)?;
 
         let signing_key = hmac::Key::new(hmac::HMAC_SHA256, &connector_webhook_secrets.secret);
         let signed_message = hmac::sign(&signing_key, &message);
-        let payload_sign = consts::BASE64_ENGINE.encode(signed_message.as_ref());
+        let payload_sign = BASE64_ENGINE.encode(signed_message.as_ref());
         Ok(payload_sign.as_bytes().eq(&signature))
     }
 
     fn get_webhook_source_verification_message(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
+        request: &IncomingWebhookRequestDetails<'_>,
         _merchant_id: &common_utils::id_type::MerchantId,
-        _connector_webhook_secrets: &api_models::webhooks::ConnectorWebhookSecrets,
-    ) -> CustomResult<Vec<u8>, errors::ConnectorError> {
+        _connector_webhook_secrets: &ConnectorWebhookSecrets,
+    ) -> CustomResult<Vec<u8>, ConnectorError> {
         Ok(request.body.to_vec())
     }
 
     fn get_webhook_object_reference_id(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<api_models::webhooks::ObjectReferenceId, errors::ConnectorError> {
+        request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<ObjectReferenceId, ConnectorError> {
         let resource: riskified::RiskifiedWebhookBody = request
             .body
             .parse_struct("RiskifiedWebhookBody")
-            .change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?;
-        Ok(api::webhooks::ObjectReferenceId::PaymentId(
+            .change_context(ConnectorError::WebhookReferenceIdNotFound)?;
+        Ok(ObjectReferenceId::PaymentId(
             api_models::payments::PaymentIdType::PaymentAttemptId(resource.id),
         ))
     }
 
     fn get_webhook_event_type(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> {
+        request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<IncomingWebhookEvent, ConnectorError> {
         let resource: riskified::RiskifiedWebhookBody = request
             .body
             .parse_struct("RiskifiedWebhookBody")
-            .change_context(errors::ConnectorError::WebhookEventTypeNotFound)?;
-        Ok(api::IncomingWebhookEvent::from(resource.status))
+            .change_context(ConnectorError::WebhookEventTypeNotFound)?;
+        Ok(IncomingWebhookEvent::from(resource.status))
     }
 
     fn get_webhook_resource_object(
         &self,
-        request: &api::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
+        request: &IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, ConnectorError> {
         let resource: riskified::RiskifiedWebhookBody = request
             .body
             .parse_struct("RiskifiedWebhookBody")
-            .change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
+            .change_context(ConnectorError::WebhookResourceObjectNotFound)?;
         Ok(Box::new(resource))
     }
 }
diff --git a/crates/router/src/connector/riskified/transformers.rs b/crates/hyperswitch_connectors/src/connectors/riskified/transformers.rs
similarity index 100%
rename from crates/router/src/connector/riskified/transformers.rs
rename to crates/hyperswitch_connectors/src/connectors/riskified/transformers.rs
diff --git a/crates/router/src/connector/riskified/transformers/api.rs b/crates/hyperswitch_connectors/src/connectors/riskified/transformers/api.rs
similarity index 82%
rename from crates/router/src/connector/riskified/transformers/api.rs
rename to crates/hyperswitch_connectors/src/connectors/riskified/transformers/api.rs
index e8c1b874417..7ce3ac979e3 100644
--- a/crates/router/src/connector/riskified/transformers/api.rs
+++ b/crates/hyperswitch_connectors/src/connectors/riskified/transformers/api.rs
@@ -1,4 +1,5 @@
-use api_models::payments::AdditionalPaymentData;
+use api_models::{payments::AdditionalPaymentData, webhooks::IncomingWebhookEvent};
+use common_enums::{Currency, FraudCheckStatus};
 use common_utils::{
     ext_traits::ValueExt,
     id_type,
@@ -6,26 +7,32 @@ use common_utils::{
     types::{AmountConvertor, StringMajorUnit, StringMajorUnitForConnector},
 };
 use error_stack::{self, ResultExt};
+use hyperswitch_domain_models::{
+    router_data::RouterData,
+    router_flow_types::Fulfillment,
+    router_request_types::{
+        fraud_check::{FraudCheckFulfillmentData, FulfillmentStatus},
+        BrowserInformation, ResponseId,
+    },
+    router_response_types::fraud_check::FraudCheckResponseData,
+};
+use hyperswitch_interfaces::errors::ConnectorError;
 use masking::Secret;
 use serde::{Deserialize, Serialize};
 use time::PrimitiveDateTime;
 
 use crate::{
-    connector::utils::{
-        convert_amount, AddressDetailsData, FraudCheckCheckoutRequest,
-        FraudCheckTransactionRequest, RouterData,
-    },
-    core::{errors, fraud_check::types as core_types},
     types::{
-        self,
-        api::{self, Fulfillment},
-        fraud_check as frm_types,
-        storage::enums as storage_enums,
-        ResponseId, ResponseRouterData,
+        FrmCheckoutRouterData, FrmFulfillmentRouterData, FrmTransactionRouterData,
+        ResponseRouterData,
+    },
+    utils::{
+        convert_amount, AddressDetailsData as _, FraudCheckCheckoutRequest,
+        FraudCheckTransactionRequest, RouterData as _,
     },
 };
 
-type Error = error_stack::Report<errors::ConnectorError>;
+type Error = error_stack::Report<ConnectorError>;
 
 pub struct RiskifiedRouterData<T> {
     pub amount: StringMajorUnit,
@@ -55,7 +62,7 @@ pub struct CheckoutRequest {
     email: Option<Email>,
     #[serde(with = "common_utils::custom_serde::iso8601")]
     created_at: PrimitiveDateTime,
-    currency: Option<common_enums::Currency>,
+    currency: Option<Currency>,
     #[serde(with = "common_utils::custom_serde::iso8601")]
     updated_at: PrimitiveDateTime,
     gateway: Option<String>,
@@ -157,22 +164,20 @@ pub struct RiskifiedMetadata {
     shipping_lines: Vec<ShippingLines>,
 }
 
-impl TryFrom<&RiskifiedRouterData<&frm_types::FrmCheckoutRouterData>>
-    for RiskifiedPaymentsCheckoutRequest
-{
+impl TryFrom<&RiskifiedRouterData<&FrmCheckoutRouterData>> for RiskifiedPaymentsCheckoutRequest {
     type Error = Error;
     fn try_from(
-        payment: &RiskifiedRouterData<&frm_types::FrmCheckoutRouterData>,
+        payment: &RiskifiedRouterData<&FrmCheckoutRouterData>,
     ) -> Result<Self, Self::Error> {
         let payment_data = payment.router_data.clone();
         let metadata: RiskifiedMetadata = payment_data
             .frm_metadata
             .clone()
-            .ok_or(errors::ConnectorError::MissingRequiredField {
+            .ok_or(ConnectorError::MissingRequiredField {
                 field_name: "frm_metadata",
             })?
             .parse_value("Riskified Metadata")
-            .change_context(errors::ConnectorError::InvalidDataFormat {
+            .change_context(ConnectorError::InvalidDataFormat {
                 field_name: "frm_metadata",
             })?;
         let billing_address = payment_data.get_billing()?;
@@ -187,7 +192,7 @@ impl TryFrom<&RiskifiedRouterData<&frm_types::FrmCheckoutRouterData>>
                     payment.amount_converter,
                     order_detail.amount,
                     payment_data.request.currency.ok_or_else(|| {
-                        errors::ConnectorError::MissingRequiredField {
+                        ConnectorError::MissingRequiredField {
                             field_name: "currency",
                         }
                     })?,
@@ -251,7 +256,7 @@ impl TryFrom<&RiskifiedRouterData<&frm_types::FrmCheckoutRouterData>>
                         .as_ref()
                         .and_then(|browser_info| browser_info.user_agent.clone()),
                     accept_language: payment_data.request.browser_info.as_ref().and_then(
-                        |browser_info: &types::BrowserInformation| browser_info.language.clone(),
+                        |browser_info: &BrowserInformation| browser_info.language.clone(),
                     ),
                 },
                 note: payment_data.description.clone(),
@@ -312,23 +317,17 @@ pub enum PaymentStatus {
     Processing,
 }
 
-impl<F, T>
-    TryFrom<ResponseRouterData<F, RiskifiedPaymentsResponse, T, frm_types::FraudCheckResponseData>>
-    for types::RouterData<F, T, frm_types::FraudCheckResponseData>
+impl<F, T> TryFrom<ResponseRouterData<F, RiskifiedPaymentsResponse, T, FraudCheckResponseData>>
+    for RouterData<F, T, FraudCheckResponseData>
 {
     type Error = Error;
     fn try_from(
-        item: ResponseRouterData<
-            F,
-            RiskifiedPaymentsResponse,
-            T,
-            frm_types::FraudCheckResponseData,
-        >,
+        item: ResponseRouterData<F, RiskifiedPaymentsResponse, T, FraudCheckResponseData>,
     ) -> Result<Self, Self::Error> {
         Ok(Self {
-            response: Ok(frm_types::FraudCheckResponseData::TransactionResponse {
+            response: Ok(FraudCheckResponseData::TransactionResponse {
                 resource_id: ResponseId::ConnectorTransactionId(item.response.order.id),
-                status: storage_enums::FraudCheckStatus::from(item.response.order.status),
+                status: FraudCheckStatus::from(item.response.order.status),
                 connector_metadata: None,
                 score: None,
                 reason: item.response.order.description.map(serde_json::Value::from),
@@ -338,7 +337,7 @@ impl<F, T>
     }
 }
 
-impl From<PaymentStatus> for storage_enums::FraudCheckStatus {
+impl From<PaymentStatus> for FraudCheckStatus {
     fn from(item: PaymentStatus) -> Self {
         match item {
             PaymentStatus::Approved => Self::Legit,
@@ -372,9 +371,9 @@ pub struct AuthorizationError {
     message: Option<String>,
 }
 
-impl TryFrom<&frm_types::FrmTransactionRouterData> for TransactionFailedRequest {
+impl TryFrom<&FrmTransactionRouterData> for TransactionFailedRequest {
     type Error = Error;
-    fn try_from(item: &frm_types::FrmTransactionRouterData) -> Result<Self, Self::Error> {
+    fn try_from(item: &FrmTransactionRouterData) -> Result<Self, Self::Error> {
         Ok(Self {
             checkout: FailedTransactionData {
                 id: item.attempt_id.clone(),
@@ -404,28 +403,17 @@ pub enum RiskifiedTransactionResponse {
 }
 
 impl<F, T>
-    TryFrom<
-        ResponseRouterData<
-            F,
-            RiskifiedFailedTransactionResponse,
-            T,
-            frm_types::FraudCheckResponseData,
-        >,
-    > for types::RouterData<F, T, frm_types::FraudCheckResponseData>
+    TryFrom<ResponseRouterData<F, RiskifiedFailedTransactionResponse, T, FraudCheckResponseData>>
+    for RouterData<F, T, FraudCheckResponseData>
 {
     type Error = Error;
     fn try_from(
-        item: ResponseRouterData<
-            F,
-            RiskifiedFailedTransactionResponse,
-            T,
-            frm_types::FraudCheckResponseData,
-        >,
+        item: ResponseRouterData<F, RiskifiedFailedTransactionResponse, T, FraudCheckResponseData>,
     ) -> Result<Self, Self::Error> {
         Ok(Self {
-            response: Ok(frm_types::FraudCheckResponseData::TransactionResponse {
+            response: Ok(FraudCheckResponseData::TransactionResponse {
                 resource_id: ResponseId::ConnectorTransactionId(item.response.checkout.id),
-                status: storage_enums::FraudCheckStatus::from(item.response.checkout.status),
+                status: FraudCheckStatus::from(item.response.checkout.status),
                 connector_metadata: None,
                 score: None,
                 reason: item
@@ -455,7 +443,7 @@ pub struct TransactionDecisionData {
     external_status: TransactionStatus,
     reason: Option<String>,
     amount: StringMajorUnit,
-    currency: storage_enums::Currency,
+    currency: Currency,
     #[serde(with = "common_utils::custom_serde::iso8601")]
     decided_at: PrimitiveDateTime,
     payment_details: Vec<TransactionPaymentDetails>,
@@ -472,12 +460,10 @@ pub enum TransactionStatus {
     Approved,
 }
 
-impl TryFrom<&RiskifiedRouterData<&frm_types::FrmTransactionRouterData>>
-    for TransactionSuccessRequest
-{
+impl TryFrom<&RiskifiedRouterData<&FrmTransactionRouterData>> for TransactionSuccessRequest {
     type Error = Error;
     fn try_from(
-        item_data: &RiskifiedRouterData<&frm_types::FrmTransactionRouterData>,
+        item_data: &RiskifiedRouterData<&FrmTransactionRouterData>,
     ) -> Result<Self, Self::Error> {
         let item = item_data.router_data.clone();
         Ok(Self {
@@ -530,16 +516,16 @@ pub struct FulfilmentData {
     tracking_url: Option<String>,
 }
 
-impl TryFrom<&frm_types::FrmFulfillmentRouterData> for RiskifiedFulfillmentRequest {
+impl TryFrom<&FrmFulfillmentRouterData> for RiskifiedFulfillmentRequest {
     type Error = Error;
-    fn try_from(item: &frm_types::FrmFulfillmentRouterData) -> Result<Self, Self::Error> {
+    fn try_from(item: &FrmFulfillmentRouterData) -> Result<Self, Self::Error> {
         let tracking_number = item
             .request
             .fulfillment_req
             .tracking_numbers
             .as_ref()
             .and_then(|numbers| numbers.first().cloned())
-            .ok_or(errors::ConnectorError::MissingRequiredField {
+            .ok_or(ConnectorError::MissingRequiredField {
                 field_name: "tracking_number",
             })?;
         let tracking_url = item
@@ -565,7 +551,7 @@ impl TryFrom<&frm_types::FrmFulfillmentRouterData> for RiskifiedFulfillmentReque
                         .fulfillment_req
                         .tracking_company
                         .clone()
-                        .ok_or(errors::ConnectorError::MissingRequiredField {
+                        .ok_or(ConnectorError::MissingRequiredField {
                             field_name: "tracking_company",
                         })?,
                     tracking_number,
@@ -581,27 +567,22 @@ impl
         ResponseRouterData<
             Fulfillment,
             RiskifiedFulfilmentResponse,
-            frm_types::FraudCheckFulfillmentData,
-            frm_types::FraudCheckResponseData,
+            FraudCheckFulfillmentData,
+            FraudCheckResponseData,
         >,
-    >
-    for types::RouterData<
-        Fulfillment,
-        frm_types::FraudCheckFulfillmentData,
-        frm_types::FraudCheckResponseData,
-    >
+    > for RouterData<Fulfillment, FraudCheckFulfillmentData, FraudCheckResponseData>
 {
     type Error = Error;
     fn try_from(
         item: ResponseRouterData<
             Fulfillment,
             RiskifiedFulfilmentResponse,
-            frm_types::FraudCheckFulfillmentData,
-            frm_types::FraudCheckResponseData,
+            FraudCheckFulfillmentData,
+            FraudCheckResponseData,
         >,
     ) -> Result<Self, Self::Error> {
         Ok(Self {
-            response: Ok(frm_types::FraudCheckResponseData::FulfillmentResponse {
+            response: Ok(FraudCheckResponseData::FulfillmentResponse {
                 order_id: item.response.order.id,
                 shipment_ids: Vec::new(),
             }),
@@ -625,13 +606,12 @@ impl TryFrom<&hyperswitch_domain_models::address::Address> for OrderAddress {
     fn try_from(
         address_info: &hyperswitch_domain_models::address::Address,
     ) -> Result<Self, Self::Error> {
-        let address =
-            address_info
-                .clone()
-                .address
-                .ok_or(errors::ConnectorError::MissingRequiredField {
-                    field_name: "address",
-                })?;
+        let address = address_info
+            .clone()
+            .address
+            .ok_or(ConnectorError::MissingRequiredField {
+                field_name: "address",
+            })?;
         Ok(Self {
             first_name: address.first_name.clone(),
             last_name: address.last_name.clone(),
@@ -648,13 +628,11 @@ impl TryFrom<&hyperswitch_domain_models::address::Address> for OrderAddress {
     }
 }
 
-fn get_fulfillment_status(
-    status: core_types::FulfillmentStatus,
-) -> Option<FulfillmentRequestStatus> {
+fn get_fulfillment_status(status: FulfillmentStatus) -> Option<FulfillmentRequestStatus> {
     match status {
-        core_types::FulfillmentStatus::COMPLETE => Some(FulfillmentRequestStatus::Success),
-        core_types::FulfillmentStatus::CANCELED => Some(FulfillmentRequestStatus::Cancelled),
-        core_types::FulfillmentStatus::PARTIAL | core_types::FulfillmentStatus::REPLACEMENT => None,
+        FulfillmentStatus::COMPLETE => Some(FulfillmentRequestStatus::Success),
+        FulfillmentStatus::CANCELED => Some(FulfillmentRequestStatus::Cancelled),
+        FulfillmentStatus::PARTIAL | FulfillmentStatus::REPLACEMENT => None,
     }
 }
 
@@ -670,7 +648,7 @@ pub enum RiskifiedWebhookStatus {
     Declined,
 }
 
-impl From<RiskifiedWebhookStatus> for api::IncomingWebhookEvent {
+impl From<RiskifiedWebhookStatus> for IncomingWebhookEvent {
     fn from(value: RiskifiedWebhookStatus) -> Self {
         match value {
             RiskifiedWebhookStatus::Declined => Self::FrmRejected,
diff --git a/crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.rs b/crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.rs
new file mode 100644
index 00000000000..2835ea01f8d
--- /dev/null
+++ b/crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.rs
@@ -0,0 +1,22 @@
+use error_stack;
+use hyperswitch_domain_models::router_data::ConnectorAuthType;
+use hyperswitch_interfaces::errors::ConnectorError;
+use masking::{ExposeInterface, Secret};
+
+pub struct RiskifiedAuthType {
+    pub secret_token: Secret<String>,
+    pub domain_name: String,
+}
+
+impl TryFrom<&ConnectorAuthType> for RiskifiedAuthType {
+    type Error = error_stack::Report<ConnectorError>;
+    fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> {
+        match auth_type {
+            ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self {
+                secret_token: api_key.to_owned(),
+                domain_name: key1.to_owned().expose(),
+            }),
+            _ => Err(ConnectorError::FailedToObtainAuthType.into()),
+        }
+    }
+}
diff --git a/crates/hyperswitch_connectors/src/default_implementations.rs b/crates/hyperswitch_connectors/src/default_implementations.rs
index c21c1d716b1..3acb8c54e27 100644
--- a/crates/hyperswitch_connectors/src/default_implementations.rs
+++ b/crates/hyperswitch_connectors/src/default_implementations.rs
@@ -158,6 +158,7 @@ default_imp_for_authorize_session_token!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -168,6 +169,7 @@ default_imp_for_authorize_session_token!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -182,6 +184,7 @@ default_imp_for_authorize_session_token!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Stripebilling,
@@ -266,12 +269,14 @@ default_imp_for_calculate_tax!(
     connectors::Opayo,
     connectors::Opennode,
     connectors::Paybox,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nuvei,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -282,6 +287,7 @@ default_imp_for_calculate_tax!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -355,6 +361,7 @@ default_imp_for_session_update!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -364,6 +371,7 @@ default_imp_for_session_update!(
     connectors::Mollie,
     connectors::Moneris,
     connectors::Multisafepay,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -375,6 +383,7 @@ default_imp_for_session_update!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paystack,
     connectors::Payu,
     connectors::Placetopay,
@@ -455,6 +464,7 @@ default_imp_for_post_session_tokens!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Square,
     connectors::Stax,
@@ -464,6 +474,7 @@ default_imp_for_post_session_tokens!(
     connectors::Mollie,
     connectors::Moneris,
     connectors::Multisafepay,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -475,6 +486,7 @@ default_imp_for_post_session_tokens!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paystack,
     connectors::Payu,
     connectors::Placetopay,
@@ -573,12 +585,14 @@ default_imp_for_update_metadata!(
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
+    connectors::Nmi,
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
     connectors::Paystack,
     connectors::Payu,
     connectors::Placetopay,
+    connectors::Payone,
     connectors::Fiuu,
     connectors::Globalpay,
     connectors::Globepay,
@@ -590,6 +604,7 @@ default_imp_for_update_metadata!(
     connectors::Xendit,
     connectors::Powertranz,
     connectors::Prophetpay,
+    connectors::Riskified,
     connectors::Thunes,
     connectors::Trustpay,
     connectors::Tsys,
@@ -660,12 +675,14 @@ default_imp_for_complete_authorize!(
     connectors::Opayo,
     connectors::Opennode,
     connectors::Payeezy,
+    connectors::Payone,
     connectors::Paystack,
     connectors::Payu,
     connectors::Placetopay,
     connectors::Rapyd,
     connectors::Razorpay,
     connectors::Recurly,
+    connectors::Riskified,
     connectors::Stax,
     connectors::Square,
     connectors::Stripebilling,
@@ -740,6 +757,7 @@ default_imp_for_incremental_authorization!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -751,6 +769,7 @@ default_imp_for_incremental_authorization!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -765,6 +784,7 @@ default_imp_for_incremental_authorization!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -844,6 +864,7 @@ default_imp_for_create_customer!(
     connectors::Mollie,
     connectors::Moneris,
     connectors::Multisafepay,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -855,6 +876,7 @@ default_imp_for_create_customer!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -865,6 +887,7 @@ default_imp_for_create_customer!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Square,
     connectors::Stripebilling,
@@ -944,6 +967,7 @@ default_imp_for_connector_redirect_response!(
     connectors::Opennode,
     connectors::Payeezy,
     connectors::Paystack,
+    connectors::Payone,
     connectors::Payu,
     connectors::Placetopay,
     connectors::Powertranz,
@@ -952,6 +976,7 @@ default_imp_for_connector_redirect_response!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1030,6 +1055,7 @@ default_imp_for_pre_processing_steps!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Paystack,
+    connectors::Payone,
     connectors::Payu,
     connectors::Placetopay,
     connectors::Powertranz,
@@ -1041,6 +1067,7 @@ default_imp_for_pre_processing_steps!(
     connectors::Rapyd,
     connectors::Razorpay,
     connectors::Recurly,
+    connectors::Riskified,
     connectors::Stax,
     connectors::Square,
     connectors::Stripebilling,
@@ -1115,6 +1142,7 @@ default_imp_for_post_processing_steps!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -1126,6 +1154,7 @@ default_imp_for_post_processing_steps!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -1140,6 +1169,7 @@ default_imp_for_post_processing_steps!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1224,12 +1254,14 @@ default_imp_for_approve!(
     connectors::Nexixpay,
     connectors::Opayo,
     connectors::Opennode,
+    connectors::Nmi,
     connectors::Nuvei,
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
     connectors::Paypal,
     connectors::Paystack,
+    connectors::Payone,
     connectors::Payu,
     connectors::Placetopay,
     connectors::Powertranz,
@@ -1242,6 +1274,7 @@ default_imp_for_approve!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1319,6 +1352,7 @@ default_imp_for_reject!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -1329,6 +1363,7 @@ default_imp_for_reject!(
     connectors::Nuvei,
     connectors::Paybox,
     connectors::Payeezy,
+    connectors::Payone,
     connectors::Payme,
     connectors::Paypal,
     connectors::Paystack,
@@ -1344,6 +1379,7 @@ default_imp_for_reject!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1421,6 +1457,7 @@ default_imp_for_webhook_source_verification!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -1429,6 +1466,7 @@ default_imp_for_webhook_source_verification!(
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
+    connectors::Payone,
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
@@ -1445,6 +1483,7 @@ default_imp_for_webhook_source_verification!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1521,6 +1560,7 @@ default_imp_for_accept_dispute!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -1532,6 +1572,7 @@ default_imp_for_accept_dispute!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -1546,6 +1587,7 @@ default_imp_for_accept_dispute!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1621,6 +1663,7 @@ default_imp_for_submit_evidence!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -1633,6 +1676,7 @@ default_imp_for_submit_evidence!(
     connectors::Payeezy,
     connectors::Payme,
     connectors::Paypal,
+    connectors::Payone,
     connectors::Paystack,
     connectors::Payu,
     connectors::Placetopay,
@@ -1646,6 +1690,7 @@ default_imp_for_submit_evidence!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1721,6 +1766,7 @@ default_imp_for_defend_dispute!(
     connectors::Juspaythreedsserver,
     connectors::Klarna,
     connectors::Helcim,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -1732,6 +1778,7 @@ default_imp_for_defend_dispute!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -1746,6 +1793,7 @@ default_imp_for_defend_dispute!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1830,6 +1878,7 @@ default_imp_for_file_upload!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -1841,6 +1890,7 @@ default_imp_for_file_upload!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -1855,6 +1905,7 @@ default_imp_for_file_upload!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1932,6 +1983,7 @@ default_imp_for_payouts!(
     connectors::Opayo,
     connectors::Opennode,
     connectors::Paybox,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nuvei,
@@ -1946,6 +1998,7 @@ default_imp_for_payouts!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Square,
     connectors::Stax,
@@ -2023,6 +2076,7 @@ default_imp_for_payouts_create!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -2033,6 +2087,7 @@ default_imp_for_payouts_create!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paystack,
     connectors::Payu,
     connectors::Placetopay,
@@ -2046,6 +2101,7 @@ default_imp_for_payouts_create!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2125,6 +2181,7 @@ default_imp_for_payouts_retrieve!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -2137,6 +2194,7 @@ default_imp_for_payouts_retrieve!(
     connectors::Payme,
     connectors::Paystack,
     connectors::Payu,
+    connectors::Payone,
     connectors::Placetopay,
     connectors::Powertranz,
     connectors::Prophetpay,
@@ -2148,6 +2206,7 @@ default_imp_for_payouts_retrieve!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2226,6 +2285,7 @@ default_imp_for_payouts_eligibility!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -2238,6 +2298,7 @@ default_imp_for_payouts_eligibility!(
     connectors::Payme,
     connectors::Paypal,
     connectors::Paystack,
+    connectors::Payone,
     connectors::Payu,
     connectors::Placetopay,
     connectors::Powertranz,
@@ -2250,6 +2311,7 @@ default_imp_for_payouts_eligibility!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2333,6 +2395,7 @@ default_imp_for_payouts_fulfill!(
     connectors::Nexixpay,
     connectors::Opayo,
     connectors::Opennode,
+    connectors::Nmi,
     connectors::Nuvei,
     connectors::Paybox,
     connectors::Payeezy,
@@ -2350,6 +2413,7 @@ default_imp_for_payouts_fulfill!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2428,6 +2492,7 @@ default_imp_for_payouts_cancel!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -2440,6 +2505,7 @@ default_imp_for_payouts_cancel!(
     connectors::Payme,
     connectors::Paypal,
     connectors::Paystack,
+    connectors::Payone,
     connectors::Payu,
     connectors::Placetopay,
     connectors::Powertranz,
@@ -2452,6 +2518,7 @@ default_imp_for_payouts_cancel!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2531,6 +2598,7 @@ default_imp_for_payouts_quote!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -2540,6 +2608,7 @@ default_imp_for_payouts_quote!(
     connectors::Nuvei,
     connectors::Paybox,
     connectors::Payeezy,
+    connectors::Payone,
     connectors::Payme,
     connectors::Paypal,
     connectors::Paystack,
@@ -2555,6 +2624,7 @@ default_imp_for_payouts_quote!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2634,6 +2704,7 @@ default_imp_for_payouts_recipient!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -2644,6 +2715,7 @@ default_imp_for_payouts_recipient!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -2658,6 +2730,7 @@ default_imp_for_payouts_recipient!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2737,6 +2810,7 @@ default_imp_for_payouts_recipient_account!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -2747,6 +2821,7 @@ default_imp_for_payouts_recipient_account!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -2761,6 +2836,7 @@ default_imp_for_payouts_recipient_account!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2841,6 +2917,7 @@ default_imp_for_frm_sale!(
     connectors::Juspaythreedsserver,
     connectors::Klarna,
     connectors::Nomupay,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -2851,6 +2928,7 @@ default_imp_for_frm_sale!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -2944,6 +3022,7 @@ default_imp_for_frm_checkout!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -2955,6 +3034,7 @@ default_imp_for_frm_checkout!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -3048,6 +3128,7 @@ default_imp_for_frm_transaction!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -3059,6 +3140,7 @@ default_imp_for_frm_transaction!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -3152,6 +3234,7 @@ default_imp_for_frm_fulfillment!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -3160,6 +3243,7 @@ default_imp_for_frm_fulfillment!(
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
+    connectors::Payone,
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
@@ -3256,6 +3340,7 @@ default_imp_for_frm_record_return!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -3267,6 +3352,7 @@ default_imp_for_frm_record_return!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -3355,6 +3441,7 @@ default_imp_for_revoking_mandates!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -3365,6 +3452,7 @@ default_imp_for_revoking_mandates!(
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -3379,6 +3467,7 @@ default_imp_for_revoking_mandates!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -3455,6 +3544,7 @@ default_imp_for_uas_pre_authentication!(
     connectors::Itaubank,
     connectors::Jpmorgan,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -3465,6 +3555,7 @@ default_imp_for_uas_pre_authentication!(
     connectors::Nuvei,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -3480,6 +3571,7 @@ default_imp_for_uas_pre_authentication!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -3554,6 +3646,7 @@ default_imp_for_uas_post_authentication!(
     connectors::Itaubank,
     connectors::Jpmorgan,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -3564,6 +3657,7 @@ default_imp_for_uas_post_authentication!(
     connectors::Nuvei,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Paystack,
     connectors::Payu,
@@ -3579,6 +3673,7 @@ default_imp_for_uas_post_authentication!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -3654,6 +3749,7 @@ default_imp_for_uas_authentication_confirmation!(
     connectors::Itaubank,
     connectors::Jpmorgan,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -3664,6 +3760,7 @@ default_imp_for_uas_authentication_confirmation!(
     connectors::Nuvei,
     connectors::Payeezy,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paystack,
     connectors::Payu,
     connectors::Powertranz,
@@ -3679,6 +3776,7 @@ default_imp_for_uas_authentication_confirmation!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -3746,6 +3844,7 @@ default_imp_for_connector_request_id!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Novalnet,
     connectors::Noon,
@@ -3757,6 +3856,7 @@ default_imp_for_connector_request_id!(
     connectors::Paystack,
     connectors::Payu,
     connectors::Payme,
+    connectors::Payone,
     connectors::Paypal,
     connectors::Powertranz,
     connectors::Prophetpay,
@@ -3770,6 +3870,7 @@ default_imp_for_connector_request_id!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -3841,6 +3942,7 @@ default_imp_for_fraud_check!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Novalnet,
     connectors::Noon,
@@ -3861,6 +3963,7 @@ default_imp_for_fraud_check!(
     connectors::Opennode,
     connectors::Paybox,
     connectors::Payme,
+    connectors::Payone,
     connectors::Placetopay,
     connectors::Rapyd,
     connectors::Razorpay,
@@ -3967,6 +4070,7 @@ default_imp_for_connector_authentication!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -3978,6 +4082,7 @@ default_imp_for_connector_authentication!(
     connectors::Payeezy,
     connectors::Paystack,
     connectors::Payu,
+    connectors::Payone,
     connectors::Powertranz,
     connectors::Prophetpay,
     connectors::Mifinity,
@@ -3992,6 +4097,7 @@ default_imp_for_connector_authentication!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -4066,6 +4172,7 @@ default_imp_for_uas_authentication!(
     connectors::Itaubank,
     connectors::Jpmorgan,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -4086,11 +4193,13 @@ default_imp_for_uas_authentication!(
     connectors::Opennode,
     connectors::Paybox,
     connectors::Payme,
+    connectors::Payone,
     connectors::Placetopay,
     connectors::Rapyd,
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -4159,6 +4268,7 @@ default_imp_for_revenue_recovery! {
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -4179,11 +4289,13 @@ default_imp_for_revenue_recovery! {
     connectors::Multisafepay,
     connectors::Paybox,
     connectors::Payme,
+    connectors::Payone,
     connectors::Placetopay,
     connectors::Rapyd,
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -4263,6 +4375,7 @@ default_imp_for_billing_connector_payment_sync!(
     connectors::Jpmorgan,
     connectors::Klarna,
     connectors::Nomupay,
+    connectors::Nmi,
     connectors::Noon,
     connectors::Novalnet,
     connectors::Nexinets,
@@ -4282,10 +4395,12 @@ default_imp_for_billing_connector_payment_sync!(
     connectors::Multisafepay,
     connectors::Paybox,
     connectors::Payme,
+    connectors::Payone,
     connectors::Placetopay,
     connectors::Rapyd,
     connectors::Razorpay,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -4362,6 +4477,7 @@ default_imp_for_revenue_recovery_record_back!(
     connectors::Jpmorgan,
     connectors::Juspaythreedsserver,
     connectors::Klarna,
+    connectors::Nmi,
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
@@ -4382,10 +4498,12 @@ default_imp_for_revenue_recovery_record_back!(
     connectors::Multisafepay,
     connectors::Paybox,
     connectors::Payme,
+    connectors::Payone,
     connectors::Placetopay,
     connectors::Rapyd,
     connectors::Razorpay,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
diff --git a/crates/hyperswitch_connectors/src/default_implementations_v2.rs b/crates/hyperswitch_connectors/src/default_implementations_v2.rs
index 41817d955a6..e593cdfc4bf 100644
--- a/crates/hyperswitch_connectors/src/default_implementations_v2.rs
+++ b/crates/hyperswitch_connectors/src/default_implementations_v2.rs
@@ -280,6 +280,8 @@ default_imp_for_new_connector_integration_payment!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -300,6 +302,7 @@ default_imp_for_new_connector_integration_payment!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -383,6 +386,8 @@ default_imp_for_new_connector_integration_refund!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -403,6 +408,7 @@ default_imp_for_new_connector_integration_refund!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -481,6 +487,8 @@ default_imp_for_new_connector_integration_connector_access_token!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -501,6 +509,7 @@ default_imp_for_new_connector_integration_connector_access_token!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -584,6 +593,8 @@ default_imp_for_new_connector_integration_accept_dispute!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -604,6 +615,7 @@ default_imp_for_new_connector_integration_accept_dispute!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -686,6 +698,8 @@ default_imp_for_new_connector_integration_submit_evidence!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -706,6 +720,7 @@ default_imp_for_new_connector_integration_submit_evidence!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -789,6 +804,8 @@ default_imp_for_new_connector_integration_defend_dispute!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -809,6 +826,7 @@ default_imp_for_new_connector_integration_defend_dispute!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -900,6 +918,8 @@ default_imp_for_new_connector_integration_file_upload!(
     connectors::Nomupay,
     connectors::Noon,
     connectors::Novalnet,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Nexinets,
     connectors::Nexixpay,
     connectors::Opayo,
@@ -922,6 +942,7 @@ default_imp_for_new_connector_integration_file_upload!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1010,6 +1031,8 @@ default_imp_for_new_connector_integration_payouts_create!(
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payme,
@@ -1027,6 +1050,7 @@ default_imp_for_new_connector_integration_payouts_create!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1112,6 +1136,8 @@ default_imp_for_new_connector_integration_payouts_eligibility!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -1132,6 +1158,7 @@ default_imp_for_new_connector_integration_payouts_eligibility!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1217,6 +1244,8 @@ default_imp_for_new_connector_integration_payouts_fulfill!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -1237,6 +1266,7 @@ default_imp_for_new_connector_integration_payouts_fulfill!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1322,6 +1352,8 @@ default_imp_for_new_connector_integration_payouts_cancel!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -1342,6 +1374,7 @@ default_imp_for_new_connector_integration_payouts_cancel!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1427,6 +1460,8 @@ default_imp_for_new_connector_integration_payouts_quote!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -1447,6 +1482,7 @@ default_imp_for_new_connector_integration_payouts_quote!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1532,6 +1568,8 @@ default_imp_for_new_connector_integration_payouts_recipient!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -1552,6 +1590,7 @@ default_imp_for_new_connector_integration_payouts_recipient!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1637,6 +1676,8 @@ default_imp_for_new_connector_integration_payouts_sync!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -1657,6 +1698,7 @@ default_imp_for_new_connector_integration_payouts_sync!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1742,6 +1784,8 @@ default_imp_for_new_connector_integration_payouts_recipient_account!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -1762,6 +1806,7 @@ default_imp_for_new_connector_integration_payouts_recipient_account!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1845,6 +1890,8 @@ default_imp_for_new_connector_integration_webhook_source_verification!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -1865,6 +1912,7 @@ default_imp_for_new_connector_integration_webhook_source_verification!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -1950,6 +1998,8 @@ default_imp_for_new_connector_integration_frm_sale!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -1970,6 +2020,7 @@ default_imp_for_new_connector_integration_frm_sale!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2055,6 +2106,8 @@ default_imp_for_new_connector_integration_frm_checkout!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -2075,6 +2128,7 @@ default_imp_for_new_connector_integration_frm_checkout!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2160,6 +2214,8 @@ default_imp_for_new_connector_integration_frm_transaction!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -2180,6 +2236,7 @@ default_imp_for_new_connector_integration_frm_transaction!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2265,6 +2322,8 @@ default_imp_for_new_connector_integration_frm_fulfillment!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -2285,6 +2344,7 @@ default_imp_for_new_connector_integration_frm_fulfillment!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2370,6 +2430,8 @@ default_imp_for_new_connector_integration_frm_record_return!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -2390,6 +2452,7 @@ default_imp_for_new_connector_integration_frm_record_return!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2472,6 +2535,8 @@ default_imp_for_new_connector_integration_revoking_mandates!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Opayo,
     connectors::Opennode,
     connectors::Nuvei,
@@ -2491,6 +2556,7 @@ default_imp_for_new_connector_integration_revoking_mandates!(
     connectors::Razorpay,
     connectors::Recurly,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2553,6 +2619,8 @@ default_imp_for_new_connector_integration_frm!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payu,
@@ -2564,6 +2632,7 @@ default_imp_for_new_connector_integration_frm!(
     connectors::Rapyd,
     connectors::Razorpay,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2667,6 +2736,7 @@ default_imp_for_new_connector_integration_connector_authentication!(
     connectors::Rapyd,
     connectors::Razorpay,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
@@ -2740,6 +2810,8 @@ default_imp_for_new_connector_integration_revenue_recovery!(
     connectors::Novalnet,
     connectors::Nexinets,
     connectors::Nexixpay,
+    connectors::Nmi,
+    connectors::Payone,
     connectors::Paybox,
     connectors::Payeezy,
     connectors::Payu,
@@ -2751,6 +2823,7 @@ default_imp_for_new_connector_integration_revenue_recovery!(
     connectors::Rapyd,
     connectors::Razorpay,
     connectors::Redsys,
+    connectors::Riskified,
     connectors::Shift4,
     connectors::Stax,
     connectors::Square,
diff --git a/crates/hyperswitch_connectors/src/types.rs b/crates/hyperswitch_connectors/src/types.rs
index 63b857e7ca2..209360d32b7 100644
--- a/crates/hyperswitch_connectors/src/types.rs
+++ b/crates/hyperswitch_connectors/src/types.rs
@@ -3,20 +3,24 @@ use hyperswitch_domain_models::types::{PayoutsData, PayoutsResponseData};
 use hyperswitch_domain_models::{
     router_data::{AccessToken, RouterData},
     router_flow_types::{
-        Accept, AccessTokenAuth, Authorize, Capture, Defend, Evidence, PSync, PreProcessing,
-        Session, Upload, Void,
+        Accept, AccessTokenAuth, Authorize, Capture, Checkout, Defend, Evidence, Fulfillment,
+        PSync, PreProcessing, Session, Transaction, Upload, Void,
     },
     router_request_types::{
+        fraud_check::{
+            FraudCheckCheckoutData, FraudCheckFulfillmentData, FraudCheckTransactionData,
+        },
         AcceptDisputeRequestData, AccessTokenRequestData, DefendDisputeRequestData,
         PaymentsAuthorizeData, PaymentsCancelData, PaymentsCaptureData, PaymentsPreProcessingData,
         PaymentsSessionData, PaymentsSyncData, RefundsData, SubmitEvidenceRequestData,
         UploadFileRequestData,
     },
     router_response_types::{
-        AcceptDisputeResponse, DefendDisputeResponse, PaymentsResponseData, RefundsResponseData,
-        SubmitEvidenceResponse, UploadFileResponse,
+        fraud_check::FraudCheckResponseData, AcceptDisputeResponse, DefendDisputeResponse,
+        PaymentsResponseData, RefundsResponseData, SubmitEvidenceResponse, UploadFileResponse,
     },
 };
+use hyperswitch_interfaces::api::ConnectorIntegration;
 
 pub(crate) type PaymentsSyncResponseRouterData<R> =
     ResponseRouterData<PSync, R, PaymentsSyncData, PaymentsResponseData>;
@@ -55,3 +59,15 @@ pub struct ResponseRouterData<Flow, R, Request, Response> {
     pub data: RouterData<Flow, Request, Response>,
     pub http_code: u16,
 }
+pub type FrmFulfillmentRouterData =
+    RouterData<Fulfillment, FraudCheckFulfillmentData, FraudCheckResponseData>;
+pub type FrmCheckoutType =
+    dyn ConnectorIntegration<Checkout, FraudCheckCheckoutData, FraudCheckResponseData>;
+pub type FrmTransactionType =
+    dyn ConnectorIntegration<Transaction, FraudCheckTransactionData, FraudCheckResponseData>;
+pub type FrmTransactionRouterData =
+    RouterData<Transaction, FraudCheckTransactionData, FraudCheckResponseData>;
+pub type FrmFulfillmentType =
+    dyn ConnectorIntegration<Fulfillment, FraudCheckFulfillmentData, FraudCheckResponseData>;
+pub type FrmCheckoutRouterData =
+    RouterData<Checkout, FraudCheckCheckoutData, FraudCheckResponseData>;
diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs
index 60cb878d9a3..e8b88df4fa2 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -38,6 +38,10 @@ use common_utils::{
     types::{AmountConvertor, MinorUnit},
 };
 use error_stack::{report, ResultExt};
+#[cfg(feature = "frm")]
+use hyperswitch_domain_models::router_request_types::fraud_check::{
+    FraudCheckCheckoutData, FraudCheckTransactionData,
+};
 use hyperswitch_domain_models::{
     address::{Address, AddressDetails, PhoneDetails},
     mandates,
@@ -69,6 +73,8 @@ use serde_json::Value;
 use time::PrimitiveDateTime;
 use unicode_normalization::UnicodeNormalization;
 
+#[cfg(feature = "frm")]
+use crate::types::FrmTransactionRouterData;
 use crate::{constants::UNSUPPORTED_ERROR_MESSAGE, types::RefreshTokenRouterData};
 
 type Error = error_stack::Report<errors::ConnectorError>;
@@ -2479,6 +2485,15 @@ macro_rules! capture_method_not_supported {
         .into())
     };
 }
+#[macro_export]
+macro_rules! get_formatted_date_time {
+    ($date_format:tt) => {{
+        let format = time::macros::format_description!($date_format);
+        time::OffsetDateTime::now_utc()
+            .format(&format)
+            .change_context(ConnectorError::InvalidDateFormat)
+    }};
+}
 
 #[macro_export]
 macro_rules! unimplemented_payment_method {
@@ -6073,6 +6088,69 @@ pub fn normalize_string(value: String) -> Result<String, regex::Error> {
     let normalized = regex.replace_all(&lowercase_value, "").to_string();
     Ok(normalized)
 }
+#[cfg(feature = "frm")]
+pub trait FrmTransactionRouterDataRequest {
+    fn is_payment_successful(&self) -> Option<bool>;
+}
+
+#[cfg(feature = "frm")]
+impl FrmTransactionRouterDataRequest for FrmTransactionRouterData {
+    fn is_payment_successful(&self) -> Option<bool> {
+        match self.status {
+            AttemptStatus::AuthenticationFailed
+            | AttemptStatus::RouterDeclined
+            | AttemptStatus::AuthorizationFailed
+            | AttemptStatus::Voided
+            | AttemptStatus::CaptureFailed
+            | AttemptStatus::Failure
+            | AttemptStatus::AutoRefunded => Some(false),
+
+            AttemptStatus::AuthenticationSuccessful
+            | AttemptStatus::PartialChargedAndChargeable
+            | AttemptStatus::Authorized
+            | AttemptStatus::Charged => Some(true),
+
+            AttemptStatus::Started
+            | AttemptStatus::AuthenticationPending
+            | AttemptStatus::Authorizing
+            | AttemptStatus::CodInitiated
+            | AttemptStatus::VoidInitiated
+            | AttemptStatus::CaptureInitiated
+            | AttemptStatus::VoidFailed
+            | AttemptStatus::PartialCharged
+            | AttemptStatus::Unresolved
+            | AttemptStatus::Pending
+            | AttemptStatus::PaymentMethodAwaited
+            | AttemptStatus::ConfirmationAwaited
+            | AttemptStatus::DeviceDataCollectionPending => None,
+        }
+    }
+}
+
+#[cfg(feature = "frm")]
+pub trait FraudCheckCheckoutRequest {
+    fn get_order_details(&self) -> Result<Vec<OrderDetailsWithAmount>, Error>;
+}
+
+#[cfg(feature = "frm")]
+impl FraudCheckCheckoutRequest for FraudCheckCheckoutData {
+    fn get_order_details(&self) -> Result<Vec<OrderDetailsWithAmount>, Error> {
+        self.order_details
+            .clone()
+            .ok_or_else(missing_field_err("order_details"))
+    }
+}
+
+#[cfg(feature = "frm")]
+pub trait FraudCheckTransactionRequest {
+    fn get_currency(&self) -> Result<enums::Currency, Error>;
+}
+#[cfg(feature = "frm")]
+impl FraudCheckTransactionRequest for FraudCheckTransactionData {
+    fn get_currency(&self) -> Result<enums::Currency, Error> {
+        self.currency.ok_or_else(missing_field_err("currency"))
+    }
+}
 
 /// Custom deserializer for Option<Currency> that treats empty strings as None
 pub fn deserialize_optional_currency<'de, D>(
diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml
index e398800788c..46f63abf501 100644
--- a/crates/router/Cargo.toml
+++ b/crates/router/Cargo.toml
@@ -103,7 +103,6 @@ serde = { version = "1.0.197", features = ["derive"] }
 serde_json = "1.0.115"
 serde_path_to_error = "0.1.16"
 serde_qs = "0.12.0"
-serde_repr = "0.1.19"
 serde_urlencoded = "0.7.1"
 serde_with = "3.7.0"
 sha1 = { version = "0.10.6" }
diff --git a/crates/router/src/connector.rs b/crates/router/src/connector.rs
index 0c4b4be1793..e78c64d6fe9 100644
--- a/crates/router/src/connector.rs
+++ b/crates/router/src/connector.rs
@@ -4,10 +4,7 @@ pub mod dummyconnector;
 pub mod ebanx;
 pub mod gpayments;
 pub mod netcetera;
-pub mod nmi;
-pub mod payone;
 pub mod plaid;
-pub mod riskified;
 pub mod signifyd;
 pub mod stripe;
 pub mod threedsecureio;
@@ -33,12 +30,13 @@ pub use hyperswitch_connectors::connectors::{
     itaubank::Itaubank, jpmorgan, jpmorgan::Jpmorgan, juspaythreedsserver,
     juspaythreedsserver::Juspaythreedsserver, klarna, klarna::Klarna, mifinity, mifinity::Mifinity,
     mollie, mollie::Mollie, moneris, moneris::Moneris, multisafepay, multisafepay::Multisafepay,
-    nexinets, nexinets::Nexinets, nexixpay, nexixpay::Nexixpay, nomupay, nomupay::Nomupay, noon,
-    noon::Noon, novalnet, novalnet::Novalnet, nuvei, nuvei::Nuvei, opayo, opayo::Opayo, opennode,
-    opennode::Opennode, paybox, paybox::Paybox, payeezy, payeezy::Payeezy, payme, payme::Payme,
-    paypal, paypal::Paypal, paystack, paystack::Paystack, payu, payu::Payu, placetopay,
-    placetopay::Placetopay, powertranz, powertranz::Powertranz, prophetpay, prophetpay::Prophetpay,
-    rapyd, rapyd::Rapyd, razorpay, razorpay::Razorpay, recurly::Recurly, redsys, redsys::Redsys,
+    nexinets, nexinets::Nexinets, nexixpay, nexixpay::Nexixpay, nmi, nmi::Nmi, nomupay,
+    nomupay::Nomupay, noon, noon::Noon, novalnet, novalnet::Novalnet, nuvei, nuvei::Nuvei, opayo,
+    opayo::Opayo, opennode, opennode::Opennode, paybox, paybox::Paybox, payeezy, payeezy::Payeezy,
+    payme, payme::Payme, payone, payone::Payone, paypal, paypal::Paypal, paystack,
+    paystack::Paystack, payu, payu::Payu, placetopay, placetopay::Placetopay, powertranz,
+    powertranz::Powertranz, prophetpay, prophetpay::Prophetpay, rapyd, rapyd::Rapyd, razorpay,
+    razorpay::Razorpay, recurly::Recurly, redsys, redsys::Redsys, riskified, riskified::Riskified,
     shift4, shift4::Shift4, square, square::Square, stax, stax::Stax, stripebilling,
     stripebilling::Stripebilling, taxjar, taxjar::Taxjar, thunes, thunes::Thunes, trustpay,
     trustpay::Trustpay, tsys, tsys::Tsys, unified_authentication_service,
@@ -51,6 +49,6 @@ pub use hyperswitch_connectors::connectors::{
 pub use self::dummyconnector::DummyConnector;
 pub use self::{
     adyenplatform::Adyenplatform, ebanx::Ebanx, gpayments::Gpayments, netcetera::Netcetera,
-    nmi::Nmi, payone::Payone, plaid::Plaid, riskified::Riskified, signifyd::Signifyd,
-    stripe::Stripe, threedsecureio::Threedsecureio, wellsfargopayout::Wellsfargopayout, wise::Wise,
+    plaid::Plaid, signifyd::Signifyd, stripe::Stripe, threedsecureio::Threedsecureio,
+    wellsfargopayout::Wellsfargopayout, wise::Wise,
 };
diff --git a/crates/router/src/connector/riskified/transformers/auth.rs b/crates/router/src/connector/riskified/transformers/auth.rs
deleted file mode 100644
index 6968bb55a59..00000000000
--- a/crates/router/src/connector/riskified/transformers/auth.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-use error_stack;
-use masking::{ExposeInterface, Secret};
-
-use crate::{core::errors, types};
-
-pub struct RiskifiedAuthType {
-    pub secret_token: Secret<String>,
-    pub domain_name: String,
-}
-
-impl TryFrom<&types::ConnectorAuthType> for RiskifiedAuthType {
-    type Error = error_stack::Report<errors::ConnectorError>;
-    fn try_from(auth_type: &types::ConnectorAuthType) -> Result<Self, Self::Error> {
-        match auth_type {
-            types::ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self {
-                secret_token: api_key.to_owned(),
-                domain_name: key1.to_owned().expose(),
-            }),
-            _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()),
-        }
-    }
-}
diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs
index afee6a42b14..cd2740d2803 100644
--- a/crates/router/src/core/payments/flows.rs
+++ b/crates/router/src/core/payments/flows.rs
@@ -225,9 +225,7 @@ default_imp_for_complete_authorize!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -265,10 +263,7 @@ default_imp_for_webhook_source_verification!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -308,10 +303,7 @@ default_imp_for_create_customer!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout,
@@ -352,9 +344,7 @@ default_imp_for_connector_redirect_response!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout,
@@ -377,10 +367,7 @@ default_imp_for_connector_request_id!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -423,10 +410,7 @@ default_imp_for_accept_dispute!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -488,10 +472,7 @@ default_imp_for_file_upload!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout,
@@ -530,10 +511,7 @@ default_imp_for_submit_evidence!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout,
@@ -572,10 +550,7 @@ default_imp_for_defend_dispute!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -630,9 +605,7 @@ default_imp_for_pre_processing_steps!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -654,13 +627,10 @@ impl<const T: u8>
 
 default_imp_for_post_processing_steps!(
     connector::Adyenplatform,
-    connector::Nmi,
     connector::Stripe,
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Payone,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout,
@@ -681,9 +651,7 @@ impl<const T: u8> Payouts for connector::DummyConnector<T> {}
 default_imp_for_payouts!(
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout
@@ -721,10 +689,7 @@ default_imp_for_payouts_create!(
     connector::Adyenplatform,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout
@@ -763,10 +728,7 @@ default_imp_for_payouts_retrieve!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -809,10 +771,7 @@ default_imp_for_payouts_eligibility!(
     connector::Adyenplatform,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -850,9 +809,7 @@ impl<const T: u8>
 default_imp_for_payouts_fulfill!(
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout
@@ -890,10 +847,7 @@ default_imp_for_payouts_cancel!(
     connector::Adyenplatform,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout
@@ -931,10 +885,7 @@ default_imp_for_payouts_quote!(
     connector::Adyenplatform,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -973,10 +924,7 @@ default_imp_for_payouts_recipient!(
     connector::Adyenplatform,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout
@@ -1018,10 +966,7 @@ default_imp_for_payouts_recipient_account!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout,
@@ -1060,10 +1005,7 @@ default_imp_for_approve!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1103,10 +1045,7 @@ default_imp_for_reject!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1131,9 +1070,7 @@ default_imp_for_fraud_check!(
     connector::Adyenplatform,
     connector::Ebanx,
     connector::Gpayments,
-    connector::Nmi,
     connector::Netcetera,
-    connector::Payone,
     connector::Plaid,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1175,8 +1112,6 @@ default_imp_for_frm_sale!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1218,8 +1153,6 @@ default_imp_for_frm_checkout!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1261,8 +1194,6 @@ default_imp_for_frm_transaction!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1304,8 +1235,6 @@ default_imp_for_frm_fulfillment!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1347,8 +1276,6 @@ default_imp_for_frm_record_return!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1388,10 +1315,7 @@ default_imp_for_incremental_authorization!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1429,10 +1353,7 @@ default_imp_for_revoking_mandates!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1528,10 +1449,7 @@ impl<const T: u8>
 default_imp_for_connector_authentication!(
     connector::Adyenplatform,
     connector::Ebanx,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Wellsfargopayout,
@@ -1567,10 +1485,7 @@ default_imp_for_authorize_session_token!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1608,10 +1523,7 @@ default_imp_for_calculate_tax!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1649,10 +1561,7 @@ default_imp_for_session_update!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1690,10 +1599,7 @@ default_imp_for_post_session_tokens!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1731,10 +1637,7 @@ default_imp_for_update_metadata!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Threedsecureio,
     connector::Wellsfargopayout,
@@ -1774,10 +1677,7 @@ default_imp_for_uas_pre_authentication!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1815,10 +1715,7 @@ default_imp_for_uas_post_authentication!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1845,10 +1742,7 @@ default_imp_for_uas_authentication_confirmation!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -1899,10 +1793,7 @@ default_imp_for_uas_authentication!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -2035,10 +1926,8 @@ default_imp_for_revenue_recovery! {
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
+
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -2080,10 +1969,7 @@ default_imp_for_billing_connector_payment_sync!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
@@ -2125,10 +2011,7 @@ default_imp_for_revenue_recovery_record_back!(
     connector::Ebanx,
     connector::Gpayments,
     connector::Netcetera,
-    connector::Nmi,
-    connector::Payone,
     connector::Plaid,
-    connector::Riskified,
     connector::Signifyd,
     connector::Stripe,
     connector::Threedsecureio,
diff --git a/crates/router/src/macros.rs b/crates/router/src/macros.rs
index 580ccb73f53..c6de30c8d0f 100644
--- a/crates/router/src/macros.rs
+++ b/crates/router/src/macros.rs
@@ -1,15 +1,5 @@
 pub use common_utils::{collect_missing_value_keys, newtype};
 
-#[macro_export]
-macro_rules! get_formatted_date_time {
-    ($date_format:tt) => {{
-        let format = time::macros::format_description!($date_format);
-        time::OffsetDateTime::now_utc()
-            .format(&format)
-            .change_context($crate::core::errors::ConnectorError::InvalidDateFormat)
-    }};
-}
-
 #[macro_export]
 macro_rules! get_payment_link_config_value_based_on_priority {
     ($config:expr, $business_config:expr, $field:ident, $default:expr) => {

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
Moving connectors (NMI,Riskified,and payone) from `router` crate to `hyperswitch_connector` crate

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [x] I added unit tests for my changes where possible

Closes #7715

# NMI test
## Create payment processor
NOTE: used 3ds enabled key
```json
{
    "connector_type": "payment_processor",
    "connector_name": "nmi",
    "connector_account_details": {
	"api_key":"********************",
        "auth_type": "BodyKey",
        "key1": "***********************"
    },
    "test_mode": false,
    "disabled": false,
    "payment_methods_enabled": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "debit",
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        },
        {
            "payment_method": "pay_later",
            "payment_method_types": [
                {
                    "payment_method_type": "klarna",
                    "payment_experience": "redirect_to_url",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "affirm",
                    "payment_experience": "redirect_to_url",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "afterpay_clearpay",
                    "payment_experience": "redirect_to_url",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "metadata": {
        "city": "NY",
        "unit": "245"
    },
    "connector_webhook_details": {
        "merchant_secret": "MyWebhookSecret"
    },
    "business_country": "US",
    "business_label": "default"
}

```
## Create payment processor Response 
```json
{
    "connector_type": "payment_processor",
    "connector_name": "nmi",
    "connector_label": "nmi_US_default",
    "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT",
    "profile_id": "pro_5wu4McY9AIOVmllRswYz",
    "connector_account_details": {
        "auth_type": "BodyKey",
        "api_key": "***************************",
        "key1": "********************************************"
    },
    "payment_methods_enabled": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "payment_experience": null,
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "debit",
                    "payment_experience": null,
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        },
        {
            "payment_method": "pay_later",
            "payment_method_types": [
                {
                    "payment_method_type": "klarna",
                    "payment_experience": "redirect_to_url",
                    "card_networks": null,
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "affirm",
                    "payment_experience": "redirect_to_url",
                    "card_networks": null,
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "afterpay_clearpay",
                    "payment_experience": "redirect_to_url",
                    "card_networks": null,
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "connector_webhook_details": {
        "merchant_secret": "MyWebhookSecret",
        "additional_secret": null
    },
    "metadata": {
        "city": "NY",
        "unit": "245"
    },
    "test_mode": false,
    "disabled": false,
    "frm_configs": null,
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "applepay_verified_domains": null,
    "pm_auth_config": null,
    "status": "active",
    "additional_merchant_data": null,
    "connector_wallets_details": null
}
```

## create payment
```json
{
    "amount": 250,
    "currency": "USD",
    "confirm": true,
    "amount_to_capture": 250,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "nithin",
    "email": "dummy@gmail.com",
    "name": "John Doe",
    "phone": "9731918444",
    "phone_country_code": "+91",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://google.com",
    "setup_future_usage": "on_session",
    "browser_info": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "127.0.0.1"
    },
    "shipping": {
        "address": {          
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        }
    },
    "routing": {
        "type": "single",
        "data": "nmi"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "payment_method": "card",
    "payment_method_type": "credit",
   "payment_method_data": {
        "card": {
            "card_number": "4000000000002503",
            "card_exp_month": "08",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "999"
        }
    },
    "billing": {
        "address": {        
            "zip": "560095",
            "country": "IN",
            "first_name": "Sakil",
            "last_name": "Mostak"
        }
    }
}
```

## create payment response 

```json
{
    "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn",
    "merchant_id": "merchant_1743143179",
    "status": "requires_customer_action",
    "amount": 250,
    "net_amount": 250,
    "shipping_cost": null,
    "amount_capturable": 250,
    "amount_received": null,
    "connector": "nmi",
    "client_secret": "pay_9hrmW9oFfnKedAy0P3Mn_secret_gJqo6Tw0eee5XPrufvo1",
    "created": "2025-03-28T10:29:46.830Z",
    "currency": "USD",
    "customer_id": "johndoe",
    "customer": {
        "id": "johndoe",
        "name": "John Doe",
        "email": "dummy@gmail.com",
        "phone": "999999999",
        "phone_country_code": "+91"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "2503",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "08",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_Qgf7HooZS0DBdeTuvyW2",
    "shipping": {
        "address": {
            "city": null,
            "country": "US",
            "line1": null,
            "line2": null,
            "line3": null,
            "zip": "94122",
            "state": null,
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": null,
            "country": "IN",
            "line1": null,
            "line2": null,
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "dummy@gmail.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_9hrmW9oFfnKedAy0P3Mn/merchant_1743143179/pay_9hrmW9oFfnKedAy0P3Mn_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "johndoe",
        "created_at": 1743157786,
        "expires": 1743161386,
        "secret": "epk_46f549a6894b47b5bb741de8aa1381b5"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "",
    "payment_link": null,
    "profile_id": "pro_5wu4McY9AIOVmllRswYz",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-03-28T10:44:46.830Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "127.0.0.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-03-28T10:29:48.266Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual",
    "issuer_error_code": null,
    "issuer_error_message": null
}
```
Open redirect url "http://localhost:8080/payments/redirect/pay_9hrmW9oFfnKedAy0P3Mn/merchant_1743143179/pay_9hrmW9oFfnKedAy0P3Mn_1"

<img width="1680" alt="Screenshot 2025-03-28 at 4 01 28 PM" src="https://github.com/user-attachments/assets/075f5bd4-c04c-4927-83dd-744d64f8a59b" />

## payment retrieve 
NOTE use `/payments/:id?force_sync=true`

Response 
```json
{
    "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn",
    "merchant_id": "merchant_1743143179",
    "status": "succeeded",
    "amount": 250,
    "net_amount": 250,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 250,
    "connector": "nmi",
    "client_secret": "pay_9hrmW9oFfnKedAy0P3Mn_secret_gJqo6Tw0eee5XPrufvo1",
    "created": "2025-03-28T10:29:46.830Z",
    "currency": "USD",
    "customer_id": "johndoe",
    "customer": {
        "id": "johndoe",
        "name": "John Doe",
        "email": "dummy@gmail.com",
        "phone": "999999999",
        "phone_country_code": "+91"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "2503",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "08",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_Qgf7HooZS0DBdeTuvyW2",
    "shipping": {
        "address": {
            "city": null,
            "country": "US",
            "line1": null,
            "line2": null,
            "line3": null,
            "zip": "94122",
            "state": null,
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": null,
            "country": "IN",
            "line1": null,
            "line2": null,
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "dummy@gmail.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "10550766500",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_9hrmW9oFfnKedAy0P3Mn_1",
    "payment_link": null,
    "profile_id": "pro_5wu4McY9AIOVmllRswYz",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-03-28T10:44:46.830Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "127.0.0.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-03-28T10:34:49.994Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual",
    "issuer_error_code": null,
    "issuer_error_message": null
}
```
## refunds

```json
  "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn",
  "amount": 250,
  "reason": "Customer returned product",
  "refund_type": "instant",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}
```

Response

```json
{
    "refund_id": "ref_rOGRIeo7mSWazFxB6TpF",
    "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn",
    "amount": 250,
    "currency": "USD",
    "status": "pending",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "unified_code": null,
    "unified_message": null,
    "created_at": "2025-03-28T10:36:26.792Z",
    "updated_at": "2025-03-28T10:36:29.898Z",
    "connector": "nmi",
    "profile_id": "pro_5wu4McY9AIOVmllRswYz",
    "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT",
    "split_refunds": null,
    "issuer_error_code": null,
    "issuer_error_message": null
}

## refund retrieve

response
```json
{
    "refund_id": "ref_rOGRIeo7mSWazFxB6TpF",
    "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn",
    "amount": 250,
    "currency": "USD",
    "status": "succeeded",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "unified_code": null,
    "unified_message": null,
    "created_at": "2025-03-28T10:36:26.792Z",
    "updated_at": "2025-03-28T10:36:54.546Z",
    "connector": "nmi",
    "profile_id": "pro_5wu4McY9AIOVmllRswYz",
    "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT",
    "split_refunds": null,
    "issuer_error_code": null,
    "issuer_error_message": null
}
```
********************************************** PAYONE ******************************
## create connector
```json
{
    "connector_type": "payout_processor",
    "connector_name": "payone",
    "connector_label": "adyen_payouts",
    "connector_account_details": {
        "auth_type": "SignatureKey",
        "api_key": "*********************",
        "api_secret": "**********************",
        "key1": "Hyperswitch"
    },
    "test_mode": true,
    "disabled": false,
    "metadata": {
        "city": "NY",
        "unit": "245",
        "endpoint_prefix": ""
    },
    "payment_methods_enabled": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "debit",
                    "payment_experience": null,
                    "card_networks": null,
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "credit",
                    "payment_experience": null,
                    "card_networks": null,
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ]
}
```
## create payouts

```json
{
    "amount": 100,
    "currency": "EUR",
    "profile_id": {{profile_id}},
    "customer": {
        "id": "new_id",
        "email": "new_cust@example.com",
        "name": "John Doe",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "connector": [
        "payone"
    ],
    "description": "Its my first payout request",
    "payout_type": "card",
    "payout_method_data": {
        "card": {
            "card_number": "5137009801943438",
            "expiry_month": "03",
            "expiry_year": "2030",
            "card_holder_name": "John Doe"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "city": "San Fransico",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "entity_type": "Individual",
    "recurring": true,
    "metadata": {
        "ref": "123"
    },
    "confirm": true,
    "auto_fulfill": true
}

```

# RISKIFIED
- Create a merchant with frm_routing_algorithm
```json
 "frm_routing_algorithm": {
      "type": "single",
      "data": "riskified"
  }
```
- create stripe MCA
- create RISKIFIED MCA
```json
{
    "connector_type": "payment_vas",
    "connector_name": "riskified",
    "connector_account_details": {
        "auth_type": "BodyKey",
        "api_key": "*************APIKEY",
        "key1": "www.juspay.com"
    },
    "connector_webhook_details": {
        "merchant_secret": "**********************MERCHANT_SECRET",
        "additional_secret": null
    },
    "test_mode": false,
    "disabled": false,
    "business_country": "US",
    "business_label": "default",
    "payment_methods_enabled": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "debit",
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        },
        {
            "payment_method": "pay_later",
            "payment_method_types": [
                {
                    "payment_method_type": "klarna",
                    "payment_experience": "redirect_to_url",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "affirm",
                    "payment_experience": "redirect_to_url",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "afterpay_clearpay",
                    "payment_experience": "redirect_to_url",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "metadata": {
        "city": "NY",
        "unit": "245"
    },
     "frm_configs": [
        {
            "gateway": "stripe",
            "payment_methods": [
                {
                    
                    "payment_method": "card",
                    "flow" : "pre"
                }
            ]
        }
    ]
}
```
- create a payment 
```json
{
  "amount": 1500000,
  "currency": "USD",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 1500000,
  "customer_id": "StripeCustomer2",
  "email": "guest@example.com",
  "name": "Bob Smith",
  "phone": "999999999",
  "phone_country_code": "+91",
  "description": "Its my first payment request",
  "authentication_type": "no_three_ds",
  "return_url": "https://google.com",
  "payment_method": "card",
  "payment_method_type": "debit",
  "payment_method_data": {
    "card": {
      "card_number": "4242424242424242",
      "card_exp_month": "10",
      "card_exp_year": "25",
      "card_holder_name": "joseph Doe",
      "card_cvc": "123"
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "31 Sherwood Gardens",
      "line3": "31 Sherwood Gardens",
      "city": "London",
      "state": "Manchester",
      "zip": "E14 9wn",
      "country": "GB",
      "first_name": "Bob",
      "last_name": "Smith"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  },
  "order_details" : [{
        "product_name" : "gillete creme",
        "quantity" : 2,
        "amount" : 600
    },
    {
        "product_name" : "gillete razor",
        "quantity" : 1,
        "amount" : 300
    }],
    "frm_metadata": {
       
        "vendor_name": "srujan",
        "shipping_lines": [
        ]
    }
}


```


- payment message should contain `frm_message` from riskified
```json
    "frm_message": {
        "frm_name": "riskified",
        "frm_transaction_id": "pay_v2TLKee8Wlw84rC7IHsj_1",
        "frm_transaction_type": "pre_frm",
        "frm_status": "legit",
        "frm_score": null,
        "frm_reason": "Reviewed and approved by Riskified",
        "frm_error": null
    }
```

