Bug: remove `configs/pg_agnostic_mit` api as it will not be used



Remove the configs/pg_agnostic_mit api as there is a new api added to enabled the same feature in this https://github.com/juspay/hyperswitch/pull/4480. Also includes changes to read the is_connector_agnostic_mit flow form the business profile.
diff --git a/crates/api_models/src/routing.rs b/crates/api_models/src/routing.rs
index 723e6eccc36..f3d966f3d9d 100644
--- a/crates/api_models/src/routing.rs
+++ b/crates/api_models/src/routing.rs
@@ -299,13 +299,6 @@ impl From<RoutableConnectorChoice> for ast::ConnectorChoice {
     }
 }
 
-#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq)]
-pub struct DetailedConnectorChoice {
-    pub enabled: bool,
-}
-
-impl common_utils::events::ApiEventMetric for DetailedConnectorChoice {}
-
 #[derive(Debug, Copy, Clone, serde::Serialize, serde::Deserialize, strum::Display, ToSchema)]
 #[serde(rename_all = "snake_case")]
 #[strum(serialize_all = "snake_case")]
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index 815c604a0e3..07bceefb0f9 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -314,6 +314,7 @@ where
                             &merchant_account,
                             &key_store,
                             &mut payment_data,
+                            &business_profile,
                         )
                         .await?;
 
@@ -415,6 +416,7 @@ where
                             &merchant_account,
                             &key_store,
                             &mut payment_data,
+                            &business_profile,
                         )
                         .await?;
 
@@ -3320,6 +3322,7 @@ where
             routing_data,
             connector_data,
             mandate_type,
+            business_profile.is_connector_agnostic_mit_enabled,
         )
         .await;
     }
@@ -3377,6 +3380,7 @@ where
             routing_data,
             connector_data,
             mandate_type,
+            business_profile.is_connector_agnostic_mit_enabled,
         )
         .await;
     }
@@ -3400,6 +3404,7 @@ pub async fn decide_multiplex_connector_for_normal_or_recurring_payment<F: Clone
     routing_data: &mut storage::RoutingData,
     connectors: Vec<api::ConnectorData>,
     mandate_type: Option<api::MandateTransactionType>,
+    is_connector_agnostic_mit_enabled: Option<bool>,
 ) -> RouterResult<ConnectorCallType> {
     match (
         payment_data.payment_intent.setup_future_usage,
@@ -3442,22 +3447,6 @@ pub async fn decide_multiplex_connector_for_normal_or_recurring_payment<F: Clone
                 .change_context(errors::ApiErrorResponse::InternalServerError)
                 .attach_printable("unable to deserialize connector mandate details")?;
 
-            let profile_id = payment_data
-                .payment_intent
-                .profile_id
-                .as_ref()
-                .ok_or(errors::ApiErrorResponse::ResourceIdNotFound)?;
-
-            let pg_agnostic = state
-                .store
-                .find_config_by_key_unwrap_or(
-                    &format!("pg_agnostic_mandate_{}", profile_id),
-                    Some("false".to_string()),
-                )
-                .await
-                .change_context(errors::ApiErrorResponse::InternalServerError)
-                .attach_printable("The pg_agnostic config was not found in the DB")?;
-
             let mut connector_choice = None;
 
             for connector_data in connectors {
@@ -3468,7 +3457,7 @@ pub async fn decide_multiplex_connector_for_normal_or_recurring_payment<F: Clone
 
                 if is_network_transaction_id_flow(
                     state,
-                    &pg_agnostic.config,
+                    is_connector_agnostic_mit_enabled,
                     connector_data.connector_name,
                     payment_method_info,
                 ) {
@@ -3588,7 +3577,7 @@ pub async fn decide_multiplex_connector_for_normal_or_recurring_payment<F: Clone
 
 pub fn is_network_transaction_id_flow(
     state: &AppState,
-    pg_agnostic: &String,
+    is_connector_agnostic_mit_enabled: Option<bool>,
     connector: enums::Connector,
     payment_method_info: &storage::PaymentMethod,
 ) -> bool {
@@ -3597,7 +3586,7 @@ pub fn is_network_transaction_id_flow(
         .network_transaction_id_supported_connectors
         .connector_list;
 
-    pg_agnostic == "true"
+    is_connector_agnostic_mit_enabled == Some(true)
         && payment_method_info.payment_method == Some(storage_enums::PaymentMethod::Card)
         && ntid_supported_connectors.contains(&connector)
         && payment_method_info.network_transaction_id.is_some()
@@ -3827,6 +3816,7 @@ where
                 routing_data,
                 connector_data,
                 mandate_type,
+                business_profile.is_connector_agnostic_mit_enabled,
             )
             .await
         }
diff --git a/crates/router/src/core/payments/operations.rs b/crates/router/src/core/payments/operations.rs
index c214decb0b4..da9a2108691 100644
--- a/crates/router/src/core/payments/operations.rs
+++ b/crates/router/src/core/payments/operations.rs
@@ -241,6 +241,7 @@ pub trait PostUpdateTracker<F, D, R: Send>: Send {
         _merchant_account: &domain::MerchantAccount,
         _key_store: &domain::MerchantKeyStore,
         _payment_data: &mut PaymentData<F>,
+        _business_profile: &storage::business_profile::BusinessProfile,
     ) -> CustomResult<(), errors::ApiErrorResponse>
     where
         F: 'b + Clone + Send + Sync,
diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs
index f4408749fd3..b40ee8e5c9c 100644
--- a/crates/router/src/core/payments/operations/payment_response.rs
+++ b/crates/router/src/core/payments/operations/payment_response.rs
@@ -89,13 +89,13 @@ impl<F: Send + Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsAuthor
         merchant_account: &domain::MerchantAccount,
         key_store: &domain::MerchantKeyStore,
         payment_data: &mut PaymentData<F>,
+        business_profile: &storage::business_profile::BusinessProfile,
     ) -> CustomResult<(), errors::ApiErrorResponse>
     where
         F: 'b + Clone + Send + Sync,
     {
         let customer_id = payment_data.payment_intent.customer_id.clone();
         let save_payment_data = tokenization::SavePaymentMethodData::from(resp);
-        let profile_id = payment_data.payment_intent.profile_id.clone();
 
         let connector_name = payment_data
             .payment_attempt
@@ -125,8 +125,8 @@ impl<F: Send + Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsAuthor
             key_store,
             Some(resp.request.amount),
             Some(resp.request.currency),
-            profile_id,
             billing_name.clone(),
+            business_profile,
         ));
 
         let is_connector_mandate = resp.request.customer_acceptance.is_some()
@@ -169,11 +169,12 @@ impl<F: Send + Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsAuthor
             let key_store = key_store.clone();
             let state = state.clone();
             let customer_id = payment_data.payment_intent.customer_id.clone();
-            let profile_id = payment_data.payment_intent.profile_id.clone();
 
             let merchant_connector_id = payment_data.payment_attempt.merchant_connector_id.clone();
             let payment_attempt = payment_data.payment_attempt.clone();
 
+            let business_profile = business_profile.clone();
+
             let amount = resp.request.amount;
             let currency = resp.request.currency;
             let payment_method_type = resp.request.payment_method_type;
@@ -195,8 +196,8 @@ impl<F: Send + Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsAuthor
                         &key_store,
                         Some(amount),
                         Some(currency),
-                        profile_id,
                         billing_name,
+                        &business_profile,
                     ))
                     .await;
 
@@ -388,6 +389,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSyncData> for
         merchant_account: &domain::MerchantAccount,
         _key_store: &domain::MerchantKeyStore,
         payment_data: &mut PaymentData<F>,
+        business_profile: &storage::business_profile::BusinessProfile,
     ) -> CustomResult<(), errors::ApiErrorResponse>
     where
         F: 'b + Clone + Send + Sync,
@@ -398,6 +400,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSyncData> for
             resp.status,
             resp.response.clone(),
             merchant_account.storage_scheme,
+            business_profile.is_connector_agnostic_mit_enabled,
         )
         .await?;
         Ok(())
@@ -587,6 +590,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa
         merchant_account: &domain::MerchantAccount,
         key_store: &domain::MerchantKeyStore,
         payment_data: &mut PaymentData<F>,
+        business_profile: &storage::business_profile::BusinessProfile,
     ) -> CustomResult<(), errors::ApiErrorResponse>
     where
         F: 'b + Clone + Send + Sync,
@@ -598,7 +602,6 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa
             .and_then(|address| address.get_optional_full_name());
         let save_payment_data = tokenization::SavePaymentMethodData::from(resp);
         let customer_id = payment_data.payment_intent.customer_id.clone();
-        let profile_id = payment_data.payment_intent.profile_id.clone();
         let connector_name = payment_data
             .payment_attempt
             .connector
@@ -622,8 +625,8 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa
                 key_store,
                 resp.request.amount,
                 Some(resp.request.currency),
-                profile_id,
                 billing_name,
+                business_profile,
             ))
             .await?;
 
@@ -674,6 +677,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::CompleteAuthorizeData
         merchant_account: &domain::MerchantAccount,
         _key_store: &domain::MerchantKeyStore,
         payment_data: &mut PaymentData<F>,
+        business_profile: &storage::business_profile::BusinessProfile,
     ) -> CustomResult<(), errors::ApiErrorResponse>
     where
         F: 'b + Clone + Send + Sync,
@@ -684,6 +688,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::CompleteAuthorizeData
             resp.status,
             resp.response.clone(),
             merchant_account.storage_scheme,
+            business_profile.is_connector_agnostic_mit_enabled,
         )
         .await?;
         Ok(())
@@ -1224,6 +1229,7 @@ async fn update_payment_method_status_and_ntid<F: Clone>(
     attempt_status: common_enums::AttemptStatus,
     payment_response: Result<types::PaymentsResponseData, ErrorResponse>,
     storage_scheme: enums::MerchantStorageScheme,
+    is_connector_agnostic_mit_enabled: Option<bool>,
 ) -> RouterResult<()> {
     if let Some(id) = &payment_data.payment_attempt.payment_method_id {
         let pm = state
@@ -1244,23 +1250,7 @@ async fn update_payment_method_status_and_ntid<F: Clone>(
 
         let network_transaction_id =
             if let Some(network_transaction_id) = pm_resp_network_transaction_id {
-                let profile_id = payment_data
-                    .payment_intent
-                    .profile_id
-                    .as_ref()
-                    .ok_or(errors::ApiErrorResponse::ResourceIdNotFound)?;
-
-                let pg_agnostic = state
-                    .store
-                    .find_config_by_key_unwrap_or(
-                        &format!("pg_agnostic_mandate_{}", profile_id),
-                        Some("false".to_string()),
-                    )
-                    .await
-                    .change_context(errors::ApiErrorResponse::InternalServerError)
-                    .attach_printable("The pg_agnostic config was not found in the DB")?;
-
-                if &pg_agnostic.config == "true"
+                if is_connector_agnostic_mit_enabled == Some(true)
                     && payment_data.payment_intent.setup_future_usage
                         == Some(diesel_models::enums::FutureUsage::OffSession)
                 {
diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rs
index 304e6edd62e..958c3f4362f 100644
--- a/crates/router/src/core/payments/tokenization.rs
+++ b/crates/router/src/core/payments/tokenization.rs
@@ -64,8 +64,8 @@ pub async fn save_payment_method<FData>(
     key_store: &domain::MerchantKeyStore,
     amount: Option<i64>,
     currency: Option<storage_enums::Currency>,
-    profile_id: Option<String>,
     billing_name: Option<masking::Secret<String>>,
+    business_profile: &storage::business_profile::BusinessProfile,
 ) -> RouterResult<(Option<String>, Option<common_enums::PaymentMethodStatus>)>
 where
     FData: mandate::MandateBehaviour + Clone,
@@ -91,21 +91,7 @@ where
 
             let network_transaction_id =
                 if let Some(network_transaction_id) = network_transaction_id {
-                    let profile_id = profile_id
-                        .as_ref()
-                        .ok_or(errors::ApiErrorResponse::ResourceIdNotFound)?;
-
-                    let pg_agnostic = state
-                        .store
-                        .find_config_by_key_unwrap_or(
-                            &format!("pg_agnostic_mandate_{}", profile_id),
-                            Some("false".to_string()),
-                        )
-                        .await
-                        .change_context(errors::ApiErrorResponse::InternalServerError)
-                        .attach_printable("The pg_agnostic config was not found in the DB")?;
-
-                    if &pg_agnostic.config == "true"
+                    if business_profile.is_connector_agnostic_mit_enabled == Some(true)
                         && save_payment_method_data.request.get_setup_future_usage()
                             == Some(storage_enums::FutureUsage::OffSession)
                     {
diff --git a/crates/router/src/core/routing.rs b/crates/router/src/core/routing.rs
index bec90c51e9c..31825617398 100644
--- a/crates/router/src/core/routing.rs
+++ b/crates/router/src/core/routing.rs
@@ -9,6 +9,7 @@ use api_models::{
 };
 #[cfg(not(feature = "business_profile_routing"))]
 use common_utils::ext_traits::{Encode, StringExt};
+#[cfg(not(feature = "business_profile_routing"))]
 use diesel_models::configs;
 #[cfg(feature = "business_profile_routing")]
 use diesel_models::routing_algorithm::RoutingAlgorithm;
@@ -806,37 +807,6 @@ pub async fn retrieve_linked_routing_config(
     }
 }
 
-pub async fn upsert_connector_agnostic_mandate_config(
-    state: AppState,
-    business_profile_id: &str,
-    mandate_config: routing_types::DetailedConnectorChoice,
-) -> RouterResponse<routing_types::DetailedConnectorChoice> {
-    let key = helpers::get_pg_agnostic_mandate_config_key(business_profile_id);
-
-    let mandate_config_str = mandate_config.enabled.to_string();
-
-    let find_config = state
-        .store
-        .find_config_by_key_unwrap_or(&key, Some(mandate_config_str.clone()))
-        .await
-        .change_context(errors::ApiErrorResponse::InternalServerError)
-        .attach_printable("error saving pg agnostic mandate config to db")?;
-
-    if find_config.config != mandate_config_str {
-        let config_update = configs::ConfigUpdate::Update {
-            config: Some(mandate_config_str),
-        };
-        state
-            .store
-            .update_config_by_key(&key, config_update)
-            .await
-            .change_context(errors::ApiErrorResponse::InternalServerError)
-            .attach_printable("error saving pg agnostic mandate config to db")?;
-    }
-
-    Ok(service_api::ApplicationResponse::Json(mandate_config))
-}
-
 pub async fn retrieve_default_routing_config_for_profiles(
     state: AppState,
     merchant_account: domain::MerchantAccount,
diff --git a/crates/router/src/core/routing/helpers.rs b/crates/router/src/core/routing/helpers.rs
index fb86ba5a87b..3702498767a 100644
--- a/crates/router/src/core/routing/helpers.rs
+++ b/crates/router/src/core/routing/helpers.rs
@@ -272,47 +272,6 @@ pub async fn update_business_profile_active_algorithm_ref(
     Ok(())
 }
 
-pub async fn get_merchant_connector_agnostic_mandate_config(
-    db: &dyn StorageInterface,
-    business_profile_id: &str,
-) -> RouterResult<Vec<routing_types::DetailedConnectorChoice>> {
-    let key = get_pg_agnostic_mandate_config_key(business_profile_id);
-    let maybe_config = db.find_config_by_key(&key).await;
-
-    match maybe_config {
-        Ok(config) => config
-            .config
-            .parse_struct("Vec<DetailedConnectorChoice>")
-            .change_context(errors::ApiErrorResponse::InternalServerError)
-            .attach_printable("pg agnostic mandate config has invalid structure"),
-
-        Err(e) if e.current_context().is_db_not_found() => {
-            let new_mandate_config: Vec<routing_types::DetailedConnectorChoice> = Vec::new();
-
-            let serialized = new_mandate_config
-                .encode_to_string_of_json()
-                .change_context(errors::ApiErrorResponse::InternalServerError)
-                .attach_printable("error serializing newly created pg agnostic mandate config")?;
-
-            let new_config = configs::ConfigNew {
-                key,
-                config: serialized,
-            };
-
-            db.insert_config(new_config)
-                .await
-                .change_context(errors::ApiErrorResponse::InternalServerError)
-                .attach_printable("error inserting new pg agnostic mandate config in db")?;
-
-            Ok(new_mandate_config)
-        }
-
-        Err(e) => Err(e)
-            .change_context(errors::ApiErrorResponse::InternalServerError)
-            .attach_printable("error fetching pg agnostic mandate config for merchant from db"),
-    }
-}
-
 pub async fn validate_connectors_in_routing_config(
     db: &dyn StorageInterface,
     key_store: &domain::MerchantKeyStore,
@@ -441,12 +400,6 @@ pub fn get_routing_dictionary_key(merchant_id: &str) -> String {
     format!("routing_dict_{merchant_id}")
 }
 
-/// Provides the identifier for the specific merchant's agnostic_mandate_config
-#[inline(always)]
-pub fn get_pg_agnostic_mandate_config_key(business_profile_id: &str) -> String {
-    format!("pg_agnostic_mandate_{business_profile_id}")
-}
-
 /// Provides the identifier for the specific merchant's default_config
 #[inline(always)]
 pub fn get_default_config_key(
diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs
index 6a8a4ee5e03..0ee44429756 100644
--- a/crates/router/src/routes/app.rs
+++ b/crates/router/src/routes/app.rs
@@ -466,10 +466,6 @@ impl Routing {
                         )
                     })),
             )
-            .service(
-                web::resource("/business_profile/{business_profile_id}/configs/pg_agnostic_mit")
-                    .route(web::post().to(cloud_routing::upsert_connector_agnostic_mandate_config)),
-            )
             .service(
                 web::resource("/default")
                     .route(web::get().to(|state, req| {
diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs
index bf91f8055d1..1e301b069ae 100644
--- a/crates/router/src/routes/lock_utils.rs
+++ b/crates/router/src/routes/lock_utils.rs
@@ -231,7 +231,6 @@ impl From<Flow> for ApiIdentifier {
             | Flow::ReconTokenRequest
             | Flow::ReconServiceRequest
             | Flow::ReconVerifyToken => Self::Recon,
-            Flow::CreateConnectorAgnosticMandateConfig => Self::Routing,
 
             Flow::RetrievePollStatus => Self::Poll,
         }
diff --git a/crates/router/src/routes/routing.rs b/crates/router/src/routes/routing.rs
index 8438424546c..556e91d8694 100644
--- a/crates/router/src/routes/routing.rs
+++ b/crates/router/src/routes/routing.rs
@@ -566,41 +566,6 @@ pub async fn routing_retrieve_linked_config(
     }
 }
 
-#[cfg(feature = "olap")]
-#[instrument(skip_all)]
-pub async fn upsert_connector_agnostic_mandate_config(
-    state: web::Data<AppState>,
-    req: HttpRequest,
-    json_payload: web::Json<routing_types::DetailedConnectorChoice>,
-    path: web::Path<String>,
-) -> impl Responder {
-    use crate::services::authentication::AuthenticationData;
-
-    let flow = Flow::CreateConnectorAgnosticMandateConfig;
-    let business_profile_id = path.into_inner();
-
-    Box::pin(oss_api::server_wrap(
-        flow,
-        state,
-        &req,
-        json_payload.into_inner(),
-        |state, _auth: AuthenticationData, mandate_config, _| {
-            Box::pin(routing::upsert_connector_agnostic_mandate_config(
-                state,
-                &business_profile_id,
-                mandate_config,
-            ))
-        },
-        auth::auth_type(
-            &auth::ApiKeyAuth,
-            &auth::JWTAuth(Permission::RoutingWrite),
-            req.headers(),
-        ),
-        api_locking::LockAction::NotApplicable,
-    ))
-    .await
-}
-
 #[cfg(feature = "olap")]
 #[instrument(skip_all)]
 pub async fn routing_retrieve_default_config_for_profiles(
diff --git a/crates/router/src/types/api/routing.rs b/crates/router/src/types/api/routing.rs
index faafac76e3d..4f982d543df 100644
--- a/crates/router/src/types/api/routing.rs
+++ b/crates/router/src/types/api/routing.rs
@@ -3,9 +3,9 @@ pub use api_models::routing::RoutableChoiceKind;
 pub use api_models::{
     enums as api_enums,
     routing::{
-        ConnectorVolumeSplit, DetailedConnectorChoice, RoutableConnectorChoice, RoutingAlgorithm,
-        RoutingAlgorithmKind, RoutingAlgorithmRef, RoutingConfigRequest, RoutingDictionary,
-        RoutingDictionaryRecord, StraightThroughAlgorithm,
+        ConnectorVolumeSplit, RoutableConnectorChoice, RoutingAlgorithm, RoutingAlgorithmKind,
+        RoutingAlgorithmRef, RoutingConfigRequest, RoutingDictionary, RoutingDictionaryRecord,
+        StraightThroughAlgorithm,
     },
 };
 
diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs
index e8ffe0685b2..14b235eadb2 100644
--- a/crates/router_env/src/logger/types.rs
+++ b/crates/router_env/src/logger/types.rs
@@ -210,8 +210,6 @@ pub enum Flow {
     RoutingRetrieveConfig,
     /// Routing retrieve active config
     RoutingRetrieveActiveConfig,
-    /// Update connector agnostic mandate config
-    CreateConnectorAgnosticMandateConfig,
     /// Routing retrieve default config
     RoutingRetrieveDefaultConfig,
     /// Routing retrieve dictionary

## 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 -->
Remove the `configs/pg_agnostic_mit` api as there is a new api added to enabled the same feature in this [pr](https://github.com/juspay/hyperswitch/pull/4480). Also this pr includes changes to read the `is_connector_agnostic_mit` flow form the business profile.

### 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)?
-->
1) Creata Merchant account
2) Enable the `connector_agnostic_mit` flow for the `profile_id`
```
curl --location 'http://localhost:8080/account/:merchant_id/business_profile/:profile_id/toggle_connector_agnostic_mit' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api_key' \
--data '{
    "enabled": true
}'
```
3) Create MCA for stripe and cybersource
4) Create a initial mandate with stripe
```
{
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "cyb111",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4111111111111111",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "737"
        }
    },
    "setup_future_usage": "off_session",
    "payment_type": "setup_mandate",
    "mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "127.0.0.1",
                "user_agent": "amet irure esse"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "metadata": {
                    "frequency": "1"
                }
                ,
                "end_date": "2025-05-03T04:07:52.723Z"
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "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": "125.0.0.1"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {},
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 0,
            "account_name": "transaction_processing"
        }
    ]
}
```
<img width="1183" alt="image" src="https://github.com/juspay/hyperswitch/assets/83439957/846d10a2-b558-4107-ae76-28e7f64eda09">
5) Copy the `payment_method_id` form the intial mandate response and do the `mit` by passing the routing connector as cybersource

```
{
    "amount": 499,
    "currency": "USD",
    "confirm": true,
    "profile_id": "pro_PUqIPYItrChfHMWQTijY",
    "capture_method": "automatic",
    "customer_id": "cyb111",
    "email": "guest@example.com",
    "off_session": true,
    "recurring_details": {
        "type": "payment_method_id",
        "data": "pm_JwKhxZ1l5Beoh3tiU38f"
    },
    "routing": {
        "type": "single",
        "data": {
            "connector": "cybersource",
            "merchant_connector_id": "mca_1AaY3OI8lL1gLv2ekaTd"
        }
    },
    "payment_method": "card",
    "billing": {
        "address": {
            "city": "test",
            "country": "US",
            "line1": "here",
            "line2": "there",
            "line3": "anywhere",
            "zip": "560095",
            "state": "Washington",
            "first_name": "One",
            "last_name": "Two"
        },
        "phone": {
            "number": "1234567890",
            "country_code": "+1"
        },
        "email": "guest@example.com"
    }
}
```
<img width="1164" alt="image" src="https://github.com/juspay/hyperswitch/assets/83439957/b0da9f2a-8bbc-4125-a207-3cda3a9ff641">

## 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
- [ ] I added unit tests for my changes where possible
