Bug: [FIX] Add fallback connectors instead of active routing rule connectors if straight through connector is ineligible



Add the fallback connectors to the list of eligible connectors instead of adding connectors configured in the active routing rule in case straight through connector is ineligible
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index 0993a6eee3f..f9fea9cdfd7 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -6743,7 +6743,7 @@ where
     }
 
     if let Some(routing_algorithm) = request_straight_through {
-        let (connectors, check_eligibility) = routing::perform_straight_through_routing(
+        let (mut connectors, check_eligibility) = routing::perform_straight_through_routing(
             &routing_algorithm,
             payment_data.get_creds_identifier(),
         )
@@ -6751,34 +6751,58 @@ where
         .attach_printable("Failed execution of straight through routing")?;
 
         if check_eligibility {
-            let new_pd = payment_data.clone();
             let transaction_data = core_routing::PaymentsDslInput::new(
-                new_pd.get_setup_mandate(),
-                new_pd.get_payment_attempt(),
-                new_pd.get_payment_intent(),
-                new_pd.get_payment_method_data(),
-                new_pd.get_address(),
-                new_pd.get_recurring_details(),
-                new_pd.get_currency(),
+                payment_data.get_setup_mandate(),
+                payment_data.get_payment_attempt(),
+                payment_data.get_payment_intent(),
+                payment_data.get_payment_method_data(),
+                payment_data.get_address(),
+                payment_data.get_recurring_details(),
+                payment_data.get_currency(),
             );
 
-            return route_connector_v1_for_payments(
-                &state,
-                merchant_context,
-                business_profile,
-                payment_data,
-                transaction_data,
-                routing_data,
+            connectors = routing::perform_eligibility_analysis_with_fallback(
+                &state.clone(),
+                merchant_context.get_merchant_key_store(),
+                connectors,
+                &TransactionData::Payment(transaction_data),
                 eligible_connectors,
-                mandate_type,
-                Some(connectors),
+                business_profile,
             )
-            .await;
+            .await
+            .change_context(errors::ApiErrorResponse::InternalServerError)
+            .attach_printable("failed eligibility analysis and fallback")?;
         }
+
+        let connector_data = connectors
+            .into_iter()
+            .map(|conn| {
+                api::ConnectorData::get_connector_by_name(
+                    &state.conf.connectors,
+                    &conn.connector.to_string(),
+                    api::GetToken::Connector,
+                    conn.merchant_connector_id.clone(),
+                )
+                .map(|connector_data| connector_data.into())
+            })
+            .collect::<CustomResult<Vec<_>, _>>()
+            .change_context(errors::ApiErrorResponse::InternalServerError)
+            .attach_printable("Invalid connector name received")?;
+
+        return decide_multiplex_connector_for_normal_or_recurring_payment(
+            &state,
+            payment_data,
+            routing_data,
+            connector_data,
+            mandate_type,
+            business_profile.is_connector_agnostic_mit_enabled,
+            business_profile.is_network_tokenization_enabled,
+        )
+        .await;
     }
 
     if let Some(ref routing_algorithm) = routing_data.routing_info.algorithm {
-        let (connectors, check_eligibility) = routing::perform_straight_through_routing(
+        let (mut connectors, check_eligibility) = routing::perform_straight_through_routing(
             routing_algorithm,
             payment_data.get_creds_identifier(),
         )
@@ -6786,30 +6810,54 @@ where
         .attach_printable("Failed execution of straight through routing")?;
 
         if check_eligibility {
-            let new_pd = payment_data.clone();
             let transaction_data = core_routing::PaymentsDslInput::new(
-                new_pd.get_setup_mandate(),
-                new_pd.get_payment_attempt(),
-                new_pd.get_payment_intent(),
-                new_pd.get_payment_method_data(),
-                new_pd.get_address(),
-                new_pd.get_recurring_details(),
-                new_pd.get_currency(),
+                payment_data.get_setup_mandate(),
+                payment_data.get_payment_attempt(),
+                payment_data.get_payment_intent(),
+                payment_data.get_payment_method_data(),
+                payment_data.get_address(),
+                payment_data.get_recurring_details(),
+                payment_data.get_currency(),
             );
 
-            return route_connector_v1_for_payments(
+            connectors = routing::perform_eligibility_analysis_with_fallback(
                 &state,
-                merchant_context,
-                business_profile,
-                payment_data,
-                transaction_data,
-                routing_data,
+                merchant_context.get_merchant_key_store(),
+                connectors,
+                &TransactionData::Payment(transaction_data),
                 eligible_connectors,
-                mandate_type,
-                Some(connectors),
+                business_profile,
             )
-            .await;
+            .await
+            .change_context(errors::ApiErrorResponse::InternalServerError)
+            .attach_printable("failed eligibility analysis and fallback")?;
         }
+
+        let connector_data = connectors
+            .into_iter()
+            .map(|conn| {
+                api::ConnectorData::get_connector_by_name(
+                    &state.conf.connectors,
+                    &conn.connector.to_string(),
+                    api::GetToken::Connector,
+                    conn.merchant_connector_id,
+                )
+                .map(|connector_data| connector_data.into())
+            })
+            .collect::<CustomResult<Vec<_>, _>>()
+            .change_context(errors::ApiErrorResponse::InternalServerError)
+            .attach_printable("Invalid connector name received")?;
+
+        return decide_multiplex_connector_for_normal_or_recurring_payment(
+            &state,
+            payment_data,
+            routing_data,
+            connector_data,
+            mandate_type,
+            business_profile.is_connector_agnostic_mit_enabled,
+            business_profile.is_network_tokenization_enabled,
+        )
+        .await;
     }
 
     let new_pd = payment_data.clone();
@@ -6832,7 +6880,6 @@ where
         routing_data,
         eligible_connectors,
         mandate_type,
-        None,
     )
     .await
 }
@@ -7411,7 +7458,6 @@ pub async fn route_connector_v1_for_payments<F, D>(
     routing_data: &mut storage::RoutingData,
     eligible_connectors: Option<Vec<enums::RoutableConnectors>>,
     mandate_type: Option<api::MandateTransactionType>,
-    connector_list: Option<Vec<api_models::routing::RoutableConnectorChoice>>,
 ) -> RouterResult<ConnectorCallType>
 where
     F: Send + Clone,
@@ -7429,7 +7475,7 @@ where
         algorithm_ref.algorithm_id
     };
 
-    let mut connectors = routing::perform_static_routing_v1(
+    let connectors = routing::perform_static_routing_v1(
         state,
         merchant_context.get_merchant_account().get_id(),
         routing_algorithm_id.as_ref(),
@@ -7439,20 +7485,10 @@ where
     .await
     .change_context(errors::ApiErrorResponse::InternalServerError)?;
 
-    // adds straight through connectors to the list of connectors in the active routing algorithm
-    // and perform eligibility analysis on the combined set of connectors
-
-    connectors = connector_list
-        .map(|mut straight_through_connectors| {
-            straight_through_connectors.extend(connectors.clone());
-            straight_through_connectors
-        })
-        .unwrap_or_else(|| connectors);
-
     #[cfg(all(feature = "v1", feature = "dynamic_routing"))]
     let payment_attempt = transaction_data.payment_attempt.clone();
 
-    connectors = routing::perform_eligibility_analysis_with_fallback(
+    let connectors = routing::perform_eligibility_analysis_with_fallback(
         &state.clone(),
         merchant_context.get_merchant_key_store(),
         connectors,

## 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 -->
Reverts https://github.com/juspay/hyperswitch/pull/7921

### 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).
-->
Closes #8208 

## 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. Payment intent create
```
curl --location 'http://localhost:8080/vs/v1/payment_intents' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'User-Agent: helloMozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36' \
--header 'api-key: dev_OCEeDmYFnj7wCLjjWlBk0AsUthfnp3B041GM6Ef0Rl*****' \
--data-urlencode 'amount=5000' \
--data-urlencode 'currency=AED' \
--data-urlencode 'confirm=true' \
--data-urlencode 'payment_method_data%5Btype%5D=card' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bnumber%5D=4456530000001096' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bexp_month%5D=12' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bexp_year%5D=2030' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bcvc%5D=123' \
--data-urlencode 'connector%5B%5D=noon' \
--data-urlencode 'capture_method=automatic' \
--data-urlencode 'customer=sahkal' \
--data-urlencode 'statementDescriptorSuffix=merchant_101' \
--data-urlencode 'metadata%5BorderId%5D=1677581650' \
--data-urlencode 'payment_method_options%5Bcard%5D%5Brequest_three_d_secure%5D=automatic' \
--data-urlencode 'description=Card Payment' \
--data-urlencode 'off_session=true' \
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Bonline%5D%5Buser_agent%5D=helloMozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36' \
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Bonline%5D%5Bip_address%5D=123.32.25.123' \
--data-urlencode 'mandate_data%5Bamount%5D=20877' \
--data-urlencode 'setup_future_usage=off_session' \
--data-urlencode 'mandate_data%5Bmandate_type%5D=single_use' \
--data-urlencode 'mandate_data%5Bstart_date%5D=12127864781' \
--data-urlencode 'mandate_data%5Bend_date%5D=21312434324' \
--data-urlencode 'return_url=https://juspay.in' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.F1IBieprH7aT7fwe7p9ZtYdOv9JgoO87iALDjScYq9Y2H2yTvVEZLJ9aYs6ShMH3iieBdvwL7PwJ5k68qINzmHzKSYZ3cp5jGpyK5FjaoJu4zUAZbLcn-z4O6ajQ5OUZBjkqfkwo4SvQfM7ceg6_dLNbVa2dj9-YBp3pNfudc5eyKxIuvxDSmNSpoXr2Hr5Y2dDV5Z-15yfmcj-IDgZNibsUSSFuwqhHHfxk87HZRLM5-9kayXyfH4i_zdYleGR-iNX_OIzpJBpDeyJ_nbADgyi1NvBiNdDYiR-xCDuS0-DZZLVoOnJkbV23Q4XGkYRQSvI8VnWHKZhvqZi3-Nev7A.s4kCZx2KOzR50uoE.kdStc4m0EQ05J3nXd4EsxFgMj9Yp6Ji4JLRB7zjHGamjsMXwIBXhpFuexx58mqIueecXTOMz6nCjasgng8XKTKNBRsDshgFAzuO690--KQVIoSjADuRVuplTVgvg6xRaZN_cgdhfqo3DYS8MSALzoL0p1ylaAZuV_LGCJOLIcrhrP56xzmTX91tGHU3Dm1md.t-2pfHjICjZdya9g9WAxvQ' \
--data-urlencode 'merchant_connector_details%5Bcreds_identifier%5D=2025-06-04T08:02:45.485Z' \
--data-urlencode 'id=1749041986' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bname%5D=sahkal' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bemail%5D=sahkalplanet@gmail.com' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bcity%5D=siliguri' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bcountry%5D=IN' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bstate%5D=westbengal' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bline1%5D=pritilata' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bzip%5D=734006' \
--data-urlencode 'metadata%5Btxn_Id%5D=sahkal_payment' \
--data-urlencode 'metadata%5BtxnUuid%5D=94hfdmoakosdkifdhaisl' \
--data-urlencode 'metadata%5Bmerchant_id%5D=sahkal' \
--data-urlencode 'metadata%5Beuler_merchant_id%5D=global_installment' \
--data-urlencode 'connector_metadata%5Bnoon%5D%5Border_category%5D=pay' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bholder_name%5D=sahkal'
```
2. Payment Intent Sync
request
```
curl --location 'http://localhost:8080/vs/v1/payment_intents/sync' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'idempodent-key: asfdasf' \
--header 'api-key: dev_OCEeDmYFnj7wCLjjWlBk0AsUthfnp3B041GM6Ef0RlN*****' \
--data-urlencode 'connector%5B%5D=noon' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.F1IBieprH7aT7fwe7p9ZtYdOv9JgoO87iALDjScYq9Y2H2yTvVEZLJ9aYs6ShMH3iieBdvwL7PwJ5k68qINzmHzKSYZ3cp5jGpyK5FjaoJu4zUAZbLcn-z4O6ajQ5OUZBjkqfkwo4SvQfM7ceg6_dLNbVa2dj9-YBp3pNfudc5eyKxIuvxDSmNSpoXr2Hr5Y2dDV5Z-15yfmcj-IDgZNibsUSSFuwqhHHfxk87HZRLM5-9kayXyfH4i_zdYleGR-iNX_OIzpJBpDeyJ_nbADgyi1NvBiNdDYiR-xCDuS0-DZZLVoOnJkbV23Q4XGkYRQSvI8VnWHKZhvqZi3-Nev7A.s4kCZx2KOzR50uoE.kdStc4m0EQ05J3nXd4EsxFgMj9Yp6Ji4JLRB7zjHGamjsMXwIBXhpFuexx58mqIueecXTOMz6nCjasgng8XKTKNBRsDshgFAzuO690--KQVIoSjADuRVuplTVgvg6xRaZN_cgdhfqo3DYS8MSALzoL0p1ylaAZuV_LGCJOLIcrhrP56xzmTX91tGHU3Dm1md.t-2pfHjICjZdya9g9WAxvQ' \
--data-urlencode 'payment_id=1749033737' \
--data-urlencode 'force_sync=true' \
--data-urlencode 'merchant_connector_details%5Bcreds_identifier%5D=2025-06-04T10:43:22.768Z'
```
response
```
{
    "id": "1749033737",
    "object": "payment_intent",
    "amount": 5000,
    "amount_received": 5000,
    "amount_capturable": 0,
    "currency": "aed",
    "status": "succeeded",
    "client_secret": "1749033737_secret_Peeso0sEVtUFnjSjN29z",
    "created": 1749033737,
    "customer": "sahkal",
    "refunds": null,
    "mandate": null,
    "metadata": {
        "txn_Id": "sahkal_payment",
        "orderId": "1677581650",
        "txnUuid": "94hfdmoakosdkifdhaisl",
        "merchant_id": "sahkal",
        "euler_merchant_id": "global_installment"
    },
    "charges": {
        "object": "list",
        "data": [],
        "has_more": false,
        "total_count": 0,
        "url": "http://placeholder"
    },
    "connector": "noon",
    "description": "Card Payment",
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": true,
    "authentication_type": "no_three_ds",
    "next_action": null,
    "cancellation_reason": null,
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1096",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "445653",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "2030",
            "card_holder_name": "sahkal",
            "payment_checks": null,
            "authentication_data": null
        }
    },
    "shipping": null,
    "billing": {
        "address": {
            "city": "siliguri",
            "country": "IN",
            "line1": "pritilata",
            "line2": null,
            "line3": null,
            "zip": null,
            "state": "westbengal",
            "first_name": null,
            "last_name": null
        },
        "phone": {
            "number": null,
            "country_code": "IN"
        },
        "email": "sahkalplanet@gmail.com"
    },
    "capture_on": null,
    "payment_token": null,
    "email": null,
    "phone": null,
    "statement_descriptor_suffix": null,
    "statement_descriptor_name": null,
    "capture_method": "automatic",
    "name": null,
    "last_payment_error": null,
    "connector_transaction_id": "613939750950"
}
```
---
Apple Pay payments
request
```
curl --location 'http://localhost:3030/vs/v1/payment_intents' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'User-Agent: EULER' \
--header 'api-key: dev_y2wL6fotKxvIj7dUjOrkGqEV7zLUzzINbc0BkK1J0Vmx4****' \
--data-urlencode 'amount=1000' \
--data-urlencode 'currency=AED' \
--data-urlencode 'confirm=true' \
--data-urlencode 'payment_method_data%5Btype%5D=wallet' \
--data-urlencode 'connector%5B%5D=noon' \
--data-urlencode 'capture_method=automatic' \
--data-urlencode 'customer=sahkal' \
--data-urlencode 'statementDescriptorSuffix=merchant_101' \
--data-urlencode 'metadata%5BorderId%5D=1677581650' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bname%5D=sahkal' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bemail%5D=sahkal.poddar@juspay.in' \
--data-urlencode 'description=card Payment' \
--data-urlencode 'off_session=true' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.F1IBieprH7aT7fwe7p9ZtYdOv9JgoO87iALDjScYq9Y2H2yTvVEZLJ9aYs6ShMH3iieBdvwL7PwJ5k68qINzmHzKSYZ3cp5jGpyK5FjaoJu4zUAZbLcn-z4O6ajQ5OUZBjkqfkwo4SvQfM7ceg6_dLNbVa2dj9-YBp3pNfudc5eyKxIuvxDSmNSpoXr2Hr5Y2dDV5Z-15yfmcj-IDgZNibsUSSFuwqhHHfxk87HZRLM5-9kayXyfH4i_zdYleGR-iNX_OIzpJBpDeyJ_nbADgyi1NvBiNdDYiR-xCDuS0-DZZLVoOnJkbV23Q4XGkYRQSvI8VnWHKZhvqZi3-Nev7A.s4kCZx2KOzR50uoE.kdStc4m0EQ05J3nXd4EsxFgMj9Yp6Ji4JLRB7zjHGamjsMXwIBXhpFuexx58mqIueecXTOMz6nCjasgng8XKTKNBRsDshgFAzuO690--KQVIoSjADuRVuplTVgvg6xRaZN_cgdhfqo3DYS8MSALzoL0p1ylaAZuV_LGCJOLIcrhrP56xzmTX91tGHU3Dm1md.t-2pfHjICjZdya9g9WAxvQ' \
--data-urlencode 'merchant_connector_details%5Bcreds_identifier%5D=EulerTest' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_data%5D=eyJkYXRhIjoiUnZRZytEMEVsTElTREpqdFpkbXAxa05QVW9zdWY5ODk1ZDVUK0cvb1pNckRaY2ZXNXdkb1Y0SVBwWHdrRnJaS25LYlhNUktXVVJiNHJua3lZV01UKzRJL01Sc0tNaSt6KzFWbjFGYitQeldVUFErZlNsSUNUMWhTWkxkTDlnOEZGb091S2xQMW8rT0xhSjAyYWlVTVpXYnpFRDlVTVY5ckllWlU5M1pIa3g4Vm1Vdmxkd0hoSEFBVzRBUkFzNDAyaXRReTRYNHNIeEIxWG8xWUtTWUZOWlR1cEFDYnBrQk5QT3JFK1k4OStxdUhDVGtTbDJxL1hVL3hNcUJYcXR1MjJFQT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NDN0SFRhSjhTRWc0R1F1aFhvYzUwcWxCdlM2M2Y2L1d3dmlhZFFUaz0iLCJlcGhlbWVyYWxQdWJsaWNLZXkiOiJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVrWW1PbWtSZGtac2w2QkFSZ2l0T043bTZFdlBER3FLWjZjRTB5elFJQ0kwUGdmc212Z2dveisvcnU5MGlTNklNeVBmN01Jek1mYUJId295ODRPOWtkZz09IiwidHJhbnNhY3Rpb25JZCI6IjU0OWJiOWEwNThmYjUxNGFiMWQ0ODZjNWMwZmU4NjlmZTlkYjg3MWUxNWY5M2Q3MWE3YTIwMzQxZjU1OTY0ZjQifSwidmVyc2lvbiI6IkVDX3YxIn0=' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_method%5D%5Bdisplay_name%5D=MasterCard 0049' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_method%5D%5Bnetwork%5D=MasterCard  ' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_method%5D%5Btype%5D=credit' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Btransaction_identifier%5D=549BB9A058FB514AB1D486C5C0FE869FE9DB871E15F93D71A7A20341F55964F4' \
--data-urlencode 'id=1749052094' \
--data-urlencode 'payment_method_types=apple_pay' \
--data-urlencode 'connector_metadata%5Bnoon%5D%5Border_category%5D=pay'
```
response
```
{
    "id": "1749051940",
    "object": "payment_intent",
    "amount": 1000,
    "amount_received": null,
    "amount_capturable": 0,
    "currency": "aed",
    "status": "canceled",
    "client_secret": "1749051940_secret_0sTFsA7eoUGpFgclZWsg",
    "created": 1749051940,
    "customer": "sahkal",
    "refunds": null,
    "mandate": null,
    "metadata": {
        "orderId": "1677581650"
    },
    "charges": {
        "object": "list",
        "data": [],
        "has_more": false,
        "total_count": 0,
        "url": "http://placeholder"
    },
    "connector": "noon",
    "description": "card Payment",
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": true,
    "authentication_type": "no_three_ds",
    "next_action": null,
    "cancellation_reason": null,
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "last4": "0049",
                "card_network": "MasterCard  ",
                "type": "credit"
            }
        }
    },
    "shipping": null,
    "billing": {
        "address": null,
        "phone": null,
        "email": "sahkal.poddar@juspay.in"
    },
    "capture_on": null,
    "payment_token": null,
    "email": null,
    "phone": null,
    "statement_descriptor_suffix": null,
    "statement_descriptor_name": null,
    "capture_method": "automatic",
    "name": null,
    "last_payment_error": {
        "charge": null,
        "code": "16200",
        "decline_code": null,
        "message": "Request data is not valid.",
        "param": null,
        "payment_method": {
            "id": "place_holder_id",
            "object": "payment_method",
            "card": null,
            "created": 1749051941,
            "type": "card",
            "livemode": false
        },
        "type": "16200"
    },
    "connector_transaction_id": null
}
```
apple pay for noon cannot be tested since we need to raise query to their support.  But we are able to go to the connector without raising any core error.

## 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
