Bug: [FIX] Fix routing approach update in wallet flow



### Feature Description

Fix routing approach update in wallet flow

### Possible Implementation

Fix routing approach update in wallet flow

### Have you spent some time checking if this feature request has been raised before?

- [x] I checked and didn't find a similar issue

### Have you read the Contributing Guidelines?

- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)

### Are you willing to submit a PR?

Yes, I am willing to submit a PR!
diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs
index 29cf75ac504..1d00a451708 100644
--- a/crates/common_enums/src/enums.rs
+++ b/crates/common_enums/src/enums.rs
@@ -8523,6 +8523,7 @@ pub enum RoutingApproach {
     DebitRouting,
     RuleBasedRouting,
     VolumeBasedRouting,
+    StraightThroughRouting,
     #[default]
     DefaultFallback,
 }
@@ -8533,6 +8534,7 @@ impl RoutingApproach {
             "SR_SELECTION_V3_ROUTING" => Self::SuccessRateExploitation,
             "SR_V3_HEDGING" => Self::SuccessRateExploration,
             "NTW_BASED_ROUTING" => Self::DebitRouting,
+            "DEFAULT" => Self::StraightThroughRouting,
             _ => Self::DefaultFallback,
         }
     }
diff --git a/crates/diesel_models/src/payment_attempt.rs b/crates/diesel_models/src/payment_attempt.rs
index 0afea0574a7..eeda9e78877 100644
--- a/crates/diesel_models/src/payment_attempt.rs
+++ b/crates/diesel_models/src/payment_attempt.rs
@@ -459,6 +459,7 @@ pub enum PaymentAttemptUpdate {
         tax_amount: Option<MinorUnit>,
         updated_by: String,
         merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
+        routing_approach: Option<storage_enums::RoutingApproach>,
     },
     AuthenticationTypeUpdate {
         authentication_type: storage_enums::AuthenticationType,
@@ -3088,6 +3089,7 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
                 tax_amount,
                 updated_by,
                 merchant_connector_id,
+                routing_approach,
             } => Self {
                 payment_token,
                 modified_at: common_utils::date_time::now(),
@@ -3146,7 +3148,7 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
                 issuer_error_code: None,
                 issuer_error_message: None,
                 setup_future_usage_applied: None,
-                routing_approach: None,
+                routing_approach,
             },
             PaymentAttemptUpdate::UnresolvedResponseUpdate {
                 status,
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
index 3a2692e5830..d644c519ea9 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
@@ -1191,6 +1191,7 @@ pub enum PaymentAttemptUpdate {
         tax_amount: Option<MinorUnit>,
         updated_by: String,
         merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
+        routing_approach: Option<storage_enums::RoutingApproach>,
     },
     AuthenticationTypeUpdate {
         authentication_type: storage_enums::AuthenticationType,
@@ -1227,7 +1228,7 @@ pub enum PaymentAttemptUpdate {
         customer_acceptance: Option<pii::SecretSerdeValue>,
         connector_mandate_detail: Option<ConnectorMandateReferenceId>,
         card_discovery: Option<common_enums::CardDiscovery>,
-        routing_approach: Option<storage_enums::RoutingApproach>, // where all to add this one
+        routing_approach: Option<storage_enums::RoutingApproach>,
     },
     RejectUpdate {
         status: storage_enums::AttemptStatus,
@@ -1413,6 +1414,7 @@ impl PaymentAttemptUpdate {
                 surcharge_amount,
                 tax_amount,
                 merchant_connector_id,
+                routing_approach,
             } => DieselPaymentAttemptUpdate::UpdateTrackers {
                 payment_token,
                 connector,
@@ -1422,6 +1424,7 @@ impl PaymentAttemptUpdate {
                 tax_amount,
                 updated_by,
                 merchant_connector_id,
+                routing_approach,
             },
             Self::AuthenticationTypeUpdate {
                 authentication_type,
diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs
index 11b1489b5cf..c42b05bd424 100644
--- a/crates/router/src/core/payment_methods/cards.rs
+++ b/crates/router/src/core/payment_methods/cards.rs
@@ -2845,7 +2845,7 @@ pub async fn list_payment_methods(
             payment_intent,
             chosen,
         };
-        let result = routing::perform_session_flow_routing(
+        let (result, routing_approach) = routing::perform_session_flow_routing(
             sfr,
             &business_profile,
             &enums::TransactionType::Payment,
@@ -3027,6 +3027,7 @@ pub async fn list_payment_methods(
             merchant_connector_id: None,
             surcharge_amount: None,
             tax_amount: None,
+            routing_approach,
         };
 
         state
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index 83176881ead..83ff156ea95 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -7331,6 +7331,10 @@ where
         .change_context(errors::ApiErrorResponse::InternalServerError)
         .attach_printable("Failed execution of straight through routing")?;
 
+        payment_data.set_routing_approach_in_attempt(Some(
+            common_enums::RoutingApproach::StraightThroughRouting,
+        ));
+
         if check_eligibility {
             let transaction_data = core_routing::PaymentsDslInput::new(
                 payment_data.get_setup_mandate(),
@@ -7911,12 +7915,12 @@ pub async fn perform_session_token_routing<F, D>(
     state: SessionState,
     merchant_context: &domain::MerchantContext,
     business_profile: &domain::Profile,
-    payment_data: &D,
+    payment_data: &mut D,
     connectors: api::SessionConnectorDatas,
 ) -> RouterResult<api::SessionConnectorDatas>
 where
     F: Clone,
-    D: OperationSessionGetters<F>,
+    D: OperationSessionGetters<F> + OperationSessionSetters<F>,
 {
     let chosen = connectors.apply_filter_for_session_routing();
     let sfr = SessionFlowRoutingInput {
@@ -7932,7 +7936,7 @@ where
         payment_intent: payment_data.get_payment_intent(),
         chosen,
     };
-    let result = self_routing::perform_session_flow_routing(
+    let (result, routing_approach) = self_routing::perform_session_flow_routing(
         sfr,
         business_profile,
         &enums::TransactionType::Payment,
@@ -7941,6 +7945,8 @@ where
     .change_context(errors::ApiErrorResponse::InternalServerError)
     .attach_printable("error performing session flow routing")?;
 
+    payment_data.set_routing_approach_in_attempt(routing_approach);
+
     let final_list = connectors.filter_and_validate_for_session_flow(&result)?;
 
     Ok(final_list)
diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs
index 4c463c74ed7..413aa121a9c 100644
--- a/crates/router/src/core/payments/operations/payment_create.rs
+++ b/crates/router/src/core/payments/operations/payment_create.rs
@@ -880,6 +880,8 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for
             .as_ref()
             .map(|surcharge_details| surcharge_details.tax_on_surcharge_amount);
 
+        let routing_approach = payment_data.payment_attempt.routing_approach;
+
         payment_data.payment_attempt = state
             .store
             .update_payment_attempt_with_attempt_id(
@@ -896,6 +898,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for
                     tax_amount,
                     updated_by: storage_scheme.to_string(),
                     merchant_connector_id,
+                    routing_approach,
                 },
                 storage_scheme,
             )
diff --git a/crates/router/src/core/payments/routing.rs b/crates/router/src/core/payments/routing.rs
index 7126ed9617e..c3823aa2f30 100644
--- a/crates/router/src/core/payments/routing.rs
+++ b/crates/router/src/core/payments/routing.rs
@@ -515,7 +515,10 @@ pub async fn perform_static_routing_v1(
     ).unwrap_or_default();
 
     let (routable_connectors, routing_approach) = match cached_algorithm.as_ref() {
-        CachedAlgorithm::Single(conn) => (vec![(**conn).clone()], None),
+        CachedAlgorithm::Single(conn) => (
+            vec![(**conn).clone()],
+            Some(common_enums::RoutingApproach::StraightThroughRouting),
+        ),
         CachedAlgorithm::Priority(plist) => (plist.clone(), None),
         CachedAlgorithm::VolumeSplit(splits) => (
             perform_volume_split(splits.to_vec())
@@ -1208,8 +1211,10 @@ pub async fn perform_session_flow_routing(
     session_input: SessionFlowRoutingInput<'_>,
     business_profile: &domain::Profile,
     transaction_type: &api_enums::TransactionType,
-) -> RoutingResult<FxHashMap<api_enums::PaymentMethodType, Vec<routing_types::SessionRoutingChoice>>>
-{
+) -> RoutingResult<(
+    FxHashMap<api_enums::PaymentMethodType, Vec<routing_types::SessionRoutingChoice>>,
+    Option<common_enums::RoutingApproach>,
+)> {
     let mut pm_type_map: FxHashMap<api_enums::PaymentMethodType, FxHashMap<String, api::GetToken>> =
         FxHashMap::default();
 
@@ -1297,6 +1302,7 @@ pub async fn perform_session_flow_routing(
         api_enums::PaymentMethodType,
         Vec<routing_types::SessionRoutingChoice>,
     > = FxHashMap::default();
+    let mut final_routing_approach = None;
 
     for (pm_type, allowed_connectors) in pm_type_map {
         let euclid_pmt: euclid_enums::PaymentMethodType = pm_type;
@@ -1315,12 +1321,15 @@ pub async fn perform_session_flow_routing(
             profile_id: &profile_id,
         };
 
-        let routable_connector_choice_option = perform_session_routing_for_pm_type(
-            &session_pm_input,
-            transaction_type,
-            business_profile,
-        )
-        .await?;
+        let (routable_connector_choice_option, routing_approach) =
+            perform_session_routing_for_pm_type(
+                &session_pm_input,
+                transaction_type,
+                business_profile,
+            )
+            .await?;
+
+        final_routing_approach = routing_approach;
 
         if let Some(routable_connector_choice) = routable_connector_choice_option {
             let mut session_routing_choice: Vec<routing_types::SessionRoutingChoice> = Vec::new();
@@ -1348,7 +1357,7 @@ pub async fn perform_session_flow_routing(
         }
     }
 
-    Ok(result)
+    Ok((result, final_routing_approach))
 }
 
 #[cfg(feature = "v1")]
@@ -1356,14 +1365,17 @@ async fn perform_session_routing_for_pm_type(
     session_pm_input: &SessionRoutingPmTypeInput<'_>,
     transaction_type: &api_enums::TransactionType,
     _business_profile: &domain::Profile,
-) -> RoutingResult<Option<Vec<api_models::routing::RoutableConnectorChoice>>> {
+) -> RoutingResult<(
+    Option<Vec<api_models::routing::RoutableConnectorChoice>>,
+    Option<common_enums::RoutingApproach>,
+)> {
     let merchant_id = &session_pm_input.key_store.merchant_id;
 
     let algorithm_id = match session_pm_input.routing_algorithm {
         MerchantAccountRoutingAlgorithm::V1(algorithm_ref) => &algorithm_ref.algorithm_id,
     };
 
-    let chosen_connectors = if let Some(ref algorithm_id) = algorithm_id {
+    let (chosen_connectors, routing_approach) = if let Some(ref algorithm_id) = algorithm_id {
         let cached_algorithm = ensure_algorithm_cached_v1(
             &session_pm_input.state.clone(),
             merchant_id,
@@ -1374,23 +1386,35 @@ async fn perform_session_routing_for_pm_type(
         .await?;
 
         match cached_algorithm.as_ref() {
-            CachedAlgorithm::Single(conn) => vec![(**conn).clone()],
-            CachedAlgorithm::Priority(plist) => plist.clone(),
-            CachedAlgorithm::VolumeSplit(splits) => perform_volume_split(splits.to_vec())
-                .change_context(errors::RoutingError::ConnectorSelectionFailed)?,
-            CachedAlgorithm::Advanced(interpreter) => execute_dsl_and_get_connector_v1(
-                session_pm_input.backend_input.clone(),
-                interpreter,
-            )?,
+            CachedAlgorithm::Single(conn) => (
+                vec![(**conn).clone()],
+                Some(common_enums::RoutingApproach::StraightThroughRouting),
+            ),
+            CachedAlgorithm::Priority(plist) => (plist.clone(), None),
+            CachedAlgorithm::VolumeSplit(splits) => (
+                perform_volume_split(splits.to_vec())
+                    .change_context(errors::RoutingError::ConnectorSelectionFailed)?,
+                Some(common_enums::RoutingApproach::VolumeBasedRouting),
+            ),
+            CachedAlgorithm::Advanced(interpreter) => (
+                execute_dsl_and_get_connector_v1(
+                    session_pm_input.backend_input.clone(),
+                    interpreter,
+                )?,
+                Some(common_enums::RoutingApproach::RuleBasedRouting),
+            ),
         }
     } else {
-        routing::helpers::get_merchant_default_config(
-            &*session_pm_input.state.clone().store,
-            session_pm_input.profile_id.get_string_repr(),
-            transaction_type,
+        (
+            routing::helpers::get_merchant_default_config(
+                &*session_pm_input.state.clone().store,
+                session_pm_input.profile_id.get_string_repr(),
+                transaction_type,
+            )
+            .await
+            .change_context(errors::RoutingError::FallbackConfigFetchFailed)?,
+            None,
         )
-        .await
-        .change_context(errors::RoutingError::FallbackConfigFetchFailed)?
     };
 
     let mut final_selection = perform_cgraph_filtering(
@@ -1426,9 +1450,9 @@ async fn perform_session_routing_for_pm_type(
     }
 
     if final_selection.is_empty() {
-        Ok(None)
+        Ok((None, routing_approach))
     } else {
-        Ok(Some(final_selection))
+        Ok((Some(final_selection), routing_approach))
     }
 }
 
diff --git a/migrations/2025-06-27-120507_update_routing_approach/down.sql b/migrations/2025-06-27-120507_update_routing_approach/down.sql
new file mode 100644
index 00000000000..c7c9cbeb401
--- /dev/null
+++ b/migrations/2025-06-27-120507_update_routing_approach/down.sql
@@ -0,0 +1,2 @@
+-- This file should undo anything in `up.sql`
+SELECT 1;
\ No newline at end of file
diff --git a/migrations/2025-06-27-120507_update_routing_approach/up.sql b/migrations/2025-06-27-120507_update_routing_approach/up.sql
new file mode 100644
index 00000000000..c7f75cb5235
--- /dev/null
+++ b/migrations/2025-06-27-120507_update_routing_approach/up.sql
@@ -0,0 +1,3 @@
+-- Your SQL goes here
+ALTER TYPE "RoutingApproach"
+ADD VALUE 'straight_through_routing';

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

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

## Description
<!-- Describe your changes in detail -->
Fixes routing approach updation for wallets flow


### 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. make wallet payment and check for `routing_approach` column in payment_attempt

ApplePay payment create - 

```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_BNOaWRzwyZ3hMAbhRNtp9t6Mx7ZSVyK5gPvd1bavl0FWehvrHlre1eMifYA244TE' \
--data-raw '{
    "amount": 650,
    "currency": "USD",
    "confirm": false,
    "business_country": "US",
    "business_label": "default",
    "amount_to_capture": 650,
    "customer_id": "cu_1751271429",
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "setup_future_usage": "off_session",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "email": "something@gmail.com",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "wallet",
    "payment_method_type": "apple_pay",
    "billing": {
        "address": {
            "line1": "1467",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "payment_data": "eyJkYXRhIjogInR1OHlCcFY3MHJ5WFpSTUJqaEt3T2VtTGhrbHlPREIzNVVLdnpNUDVFRk50eW9OMUdtK2pRRkZnaTF1T0t3WmJQZUUwdmxVUnJIeU5vQkhLOUZSY1pmYzJVL2cydytHbExweWxVcEQwc2VXdU9rRTZYb1E1SHFsZ085bFZRclZacHZsNmFndHdVYU5Cc2pqWTB0Q1F1SHRMRHQzQWI4c2pJdWhpL1g1cFNYakM0ak5PdUoxRkdJKy9CS016OHBNdUZGMkUvbmJWenhNQjhoT1lDWjlUVGdFZlN3Z3VwbE9SaFY5dFV1by9VVFhFUG40cGljNVpPYUR6WnB6Z1BuK0d1V2JVVExuL0h5Rk9MQW5xc3pNZzFkdklHcjd3c0pWRE1LUzJIdHZ5VzA2QXUzNGVSZGxkaEVWbFhnYWNDcWFualVwZlJBcVhod2VtQjNwd2p4bFBUMkxrcUE3VzJwWnNLNkF1Z0lwUi9tMTUwazFRRjl3d1AwVTF6YkpBbGc5bE9VL1IyRlVZR1BKRUZ4ay92SWowL3ZiY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mN1VGNHRGl0V1B3UVE5SFZ0d1dEZmRkZDlhelJ3VFJlL00zVUNSb3NHaEhhUklQUnNoZWp2ZWpaL0Z4MlFiamVYRmNRSnVra0creUdYUmlnTDR2MUE9PSIsCiAgICAgICAgInRyYW5zYWN0aW9uSWQiOiAiNzAwOTVhMWFjMTZkNGQ4NzAyODQ0ZDdjZDJhZGVkZWMxZmQyMzA0YTFkNmU3OTBhZWVmOWJjYzA5MmZkYjk2MSIKICAgICAgfSwKICAgICAgInZlcnNpb24iOiAiRUNfdjEifQ==",
                "payment_method": {
                    "display_name": "Discover 9319",
                    "network": "Discover",
                    "type": "credit"
                },
                "transaction_identifier": "c635c5b3af900d7bd81fecd7028f1262f9d030754ee65ec7afd988a678194751"
            }
        }
    }
}'

```
Payment method list - 

```
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_mgPMJsvP0EXSt7fDSmIF_secret_TbYn03eKtktMmmjUMTKe' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_bc5af669d7594cb7aaf277fc6b6c60dc'
```

Routing approach after this - 
<img width="850" alt="image" src="https://github.com/user-attachments/assets/4d637044-03e0-4c34-ab7c-abbe60a700fc" />

test straight_through routing - 

```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_BNOaWRzwyZ3hMAbhRNtp9t6Mx7ZSVyK5gPvd1bavl0FWehvrHlre1eMifYA244TE' \
--data-raw '{
  "amount": 6540,
  "currency": "USD",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 6540,
  "customer_id": "StripeCustomer",
  "profile_id": "pro_EfD8EtQQSPZxXStG6B7x",
  "email": "guest@example.com",
  "name": "John Doe",
  "phone": "999999999",
  "phone_country_code": "+1",
  "description": "Its my first payment request",
  "authentication_type": "no_three_ds",
  "return_url": "https://google.com",
  "payment_method": "card",
  "routing": 
    {
        "type": "single",
        "data": {"connector": "stripe", "merchant_connector_id": "mca_SdftCCtpClu32qA6oijC"}
    },
  "payment_method_type": "credit",
  "payment_method_data": {
    "card": {
      "card_number": "4242424242424242",
      "card_exp_month": "03",
      "card_exp_year": "30",
      "card_holder_name": "joseph Doe",
      "card_cvc": "737"
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "NL",
      "first_name": "joseph",
      "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": "joseph",
      "last_name": "Doe"
    },
    "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"
  },
   "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"
    }
}'
```

DB - 
<img width="852" alt="image" src="https://github.com/user-attachments/assets/6fa08603-19af-485b-bce2-9266b3419749" />





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

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