Bug: [FEATURE]: Send whole connector response in confirm and psync call



### Feature Description

Send whole connector response in confirm and psync call

### Possible Implementation

Add `all_keys_required` in confirm and psync payload. If `all_keys_required` is passed as `true`, send the whole connector response.

### 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/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index b475142a570..6d52decc7ca 100644
--- a/api-reference-v2/openapi_spec.json
+++ b/api-reference-v2/openapi_spec.json
@@ -16935,6 +16935,11 @@
             "type": "boolean",
             "description": "If enabled provides list of attempts linked to payment intent",
             "nullable": true
+          },
+          "all_keys_required": {
+            "type": "boolean",
+            "description": "If enabled, provides whole connector response",
+            "nullable": true
           }
         }
       },
@@ -18283,6 +18288,11 @@
             "type": "string",
             "description": "These are the query params that are sent in case of redirect response.\nThese can be ingested by the connector to take necessary actions.",
             "nullable": true
+          },
+          "all_keys_required": {
+            "type": "boolean",
+            "description": "If enabled, provides whole connector response",
+            "nullable": true
           }
         }
       },
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index 6e81cf80492..b313a3b3033 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -1164,6 +1164,9 @@ pub struct PaymentsRequest {
 
     /// Indicates if the redirection has to open in the iframe
     pub is_iframe_redirection_enabled: Option<bool>,
+
+    /// If enabled, provides whole connector response
+    pub all_keys_required: Option<bool>,
 }
 
 #[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
@@ -5141,6 +5144,9 @@ pub struct PaymentsResponse {
 
     /// Indicates if the redirection has to open in the iframe
     pub is_iframe_redirection_enabled: Option<bool>,
+
+    /// Contains whole connector response
+    pub whole_connector_response: Option<String>,
 }
 
 #[cfg(feature = "v2")]
@@ -5558,6 +5564,8 @@ pub struct PaymentsRetrieveRequest {
     /// These are the query params that are sent in case of redirect response.
     /// These can be ingested by the connector to take necessary actions.
     pub param: Option<String>,
+    /// If enabled, provides whole connector response
+    pub all_keys_required: Option<bool>,
 }
 
 /// Error details for the payment
@@ -6405,6 +6413,8 @@ pub struct PaymentsRetrieveRequest {
     pub expand_captures: Option<bool>,
     /// If enabled provides list of attempts linked to payment intent
     pub expand_attempts: Option<bool>,
+    /// If enabled, provides whole connector response
+    pub all_keys_required: Option<bool>,
 }
 
 #[derive(Debug, Default, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
@@ -7389,6 +7399,8 @@ pub struct PaymentRetrieveBody {
     pub expand_captures: Option<bool>,
     /// If enabled provides list of attempts linked to payment intent
     pub expand_attempts: Option<bool>,
+    /// If enabled, provides whole connector response
+    pub all_keys_required: Option<bool>,
 }
 
 #[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs
index c3c3a23baab..c24bfbc8507 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -6134,6 +6134,7 @@ pub(crate) fn convert_payment_authorize_router_response<F1, F2, T1, T2>(
         connector_mandate_request_reference_id: data.connector_mandate_request_reference_id.clone(),
         authentication_id: data.authentication_id.clone(),
         psd2_sca_exemption_type: data.psd2_sca_exemption_type,
+        whole_connector_response: data.whole_connector_response.clone(),
     }
 }
 
diff --git a/crates/hyperswitch_domain_models/src/router_data.rs b/crates/hyperswitch_domain_models/src/router_data.rs
index d3f9a2bf8cc..793808b1342 100644
--- a/crates/hyperswitch_domain_models/src/router_data.rs
+++ b/crates/hyperswitch_domain_models/src/router_data.rs
@@ -102,6 +102,9 @@ pub struct RouterData<Flow, Request, Response> {
     pub authentication_id: Option<String>,
     /// Contains the type of sca exemption required for the transaction
     pub psd2_sca_exemption_type: Option<common_enums::ScaExemptionType>,
+
+    /// Contains whole connector response
+    pub whole_connector_response: Option<String>,
 }
 
 // Different patterns of authentication.
diff --git a/crates/hyperswitch_interfaces/src/conversion_impls.rs b/crates/hyperswitch_interfaces/src/conversion_impls.rs
index e01cd5ae9e4..8e2ecc8554e 100644
--- a/crates/hyperswitch_interfaces/src/conversion_impls.rs
+++ b/crates/hyperswitch_interfaces/src/conversion_impls.rs
@@ -83,6 +83,7 @@ fn get_default_router_data<F, Req, Resp>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     }
 }
 
diff --git a/crates/router/src/compatibility/stripe/payment_intents.rs b/crates/router/src/compatibility/stripe/payment_intents.rs
index dd0bbace4fa..77e7761e67f 100644
--- a/crates/router/src/compatibility/stripe/payment_intents.rs
+++ b/crates/router/src/compatibility/stripe/payment_intents.rs
@@ -125,6 +125,7 @@ pub async fn payment_intents_retrieve(
         client_secret: query_payload.client_secret.clone(),
         expand_attempts: None,
         expand_captures: None,
+        all_keys_required: None,
     };
 
     let api_auth = auth::ApiKeyAuth {
diff --git a/crates/router/src/compatibility/stripe/setup_intents.rs b/crates/router/src/compatibility/stripe/setup_intents.rs
index d39cc0c6795..00baf1ddfb2 100644
--- a/crates/router/src/compatibility/stripe/setup_intents.rs
+++ b/crates/router/src/compatibility/stripe/setup_intents.rs
@@ -109,6 +109,7 @@ pub async fn setup_intents_retrieve(
         client_secret: query_payload.client_secret.clone(),
         expand_attempts: None,
         expand_captures: None,
+        all_keys_required: None,
     };
 
     let api_auth = auth::ApiKeyAuth {
diff --git a/crates/router/src/core/authentication/transformers.rs b/crates/router/src/core/authentication/transformers.rs
index ab28addb01b..e1cf04c20aa 100644
--- a/crates/router/src/core/authentication/transformers.rs
+++ b/crates/router/src/core/authentication/transformers.rs
@@ -206,6 +206,7 @@ pub fn construct_router_data<F: Clone, Req, Res>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type,
+        whole_connector_response: None,
     })
 }
 
diff --git a/crates/router/src/core/authentication/utils.rs b/crates/router/src/core/authentication/utils.rs
index 0e7315c5d4a..f3554d6d704 100644
--- a/crates/router/src/core/authentication/utils.rs
+++ b/crates/router/src/core/authentication/utils.rs
@@ -293,6 +293,7 @@ where
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payment_failed_response()?;
diff --git a/crates/router/src/core/disputes.rs b/crates/router/src/core/disputes.rs
index a7c9af44e85..873401d771c 100644
--- a/crates/router/src/core/disputes.rs
+++ b/crates/router/src/core/disputes.rs
@@ -217,6 +217,7 @@ pub async fn accept_dispute(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_dispute_failed_response()
@@ -340,6 +341,7 @@ pub async fn submit_evidence(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_dispute_failed_response()
@@ -378,6 +380,7 @@ pub async fn submit_evidence(
             &defend_dispute_router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .to_dispute_failed_response()
diff --git a/crates/router/src/core/files/helpers.rs b/crates/router/src/core/files/helpers.rs
index 7b5cc9af4e9..4c585ccd22a 100644
--- a/crates/router/src/core/files/helpers.rs
+++ b/crates/router/src/core/files/helpers.rs
@@ -157,6 +157,7 @@ pub async fn retrieve_file_from_connector(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .change_context(errors::ApiErrorResponse::InternalServerError)
@@ -340,6 +341,7 @@ pub async fn upload_and_get_provider_provider_file_id_profile_id(
                     &router_data,
                     payments::CallConnectorAction::Trigger,
                     None,
+                    None,
                 )
                 .await
                 .change_context(errors::ApiErrorResponse::InternalServerError)
diff --git a/crates/router/src/core/fraud_check.rs b/crates/router/src/core/fraud_check.rs
index e18f29ea838..ae8849851e3 100644
--- a/crates/router/src/core/fraud_check.rs
+++ b/crates/router/src/core/fraud_check.rs
@@ -863,6 +863,7 @@ pub async fn make_fulfillment_api_call(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payment_failed_response()?;
diff --git a/crates/router/src/core/fraud_check/flows/checkout_flow.rs b/crates/router/src/core/fraud_check/flows/checkout_flow.rs
index ae003997699..d71d810335e 100644
--- a/crates/router/src/core/fraud_check/flows/checkout_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/checkout_flow.rs
@@ -161,6 +161,7 @@ impl ConstructFlowSpecificData<frm_api::Checkout, FraudCheckCheckoutData, FraudC
             connector_mandate_request_reference_id: None,
             authentication_id: None,
             psd2_sca_exemption_type: None,
+            whole_connector_response: None,
         };
 
         Ok(router_data)
@@ -215,6 +216,7 @@ pub async fn decide_frm_flow(
         router_data,
         call_connector_action,
         None,
+        None,
     )
     .await
     .to_payment_failed_response()?;
diff --git a/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs b/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs
index 4cef8db6ced..421c255e117 100644
--- a/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs
@@ -128,6 +128,7 @@ pub async fn construct_fulfillment_router_data<'a>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
     Ok(router_data)
 }
diff --git a/crates/router/src/core/fraud_check/flows/record_return.rs b/crates/router/src/core/fraud_check/flows/record_return.rs
index b60d812f1f1..02d87853ea9 100644
--- a/crates/router/src/core/fraud_check/flows/record_return.rs
+++ b/crates/router/src/core/fraud_check/flows/record_return.rs
@@ -129,6 +129,7 @@ impl ConstructFlowSpecificData<RecordReturn, FraudCheckRecordReturnData, FraudCh
             connector_mandate_request_reference_id: None,
             authentication_id: None,
             psd2_sca_exemption_type: None,
+            whole_connector_response: None,
         };
 
         Ok(router_data)
@@ -183,6 +184,7 @@ pub async fn decide_frm_flow(
         router_data,
         call_connector_action,
         None,
+        None,
     )
     .await
     .to_payment_failed_response()?;
diff --git a/crates/router/src/core/fraud_check/flows/sale_flow.rs b/crates/router/src/core/fraud_check/flows/sale_flow.rs
index 5defd0d4b58..138097333cd 100644
--- a/crates/router/src/core/fraud_check/flows/sale_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/sale_flow.rs
@@ -137,6 +137,7 @@ impl ConstructFlowSpecificData<frm_api::Sale, FraudCheckSaleData, FraudCheckResp
             connector_mandate_request_reference_id: None,
             authentication_id: None,
             psd2_sca_exemption_type: None,
+            whole_connector_response: None,
         };
 
         Ok(router_data)
@@ -191,6 +192,7 @@ pub async fn decide_frm_flow(
         router_data,
         call_connector_action,
         None,
+        None,
     )
     .await
     .to_payment_failed_response()?;
diff --git a/crates/router/src/core/fraud_check/flows/transaction_flow.rs b/crates/router/src/core/fraud_check/flows/transaction_flow.rs
index cbf66632df4..ded83e9b7bc 100644
--- a/crates/router/src/core/fraud_check/flows/transaction_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/transaction_flow.rs
@@ -146,6 +146,7 @@ impl
             connector_mandate_request_reference_id: None,
             authentication_id: None,
             psd2_sca_exemption_type: None,
+            whole_connector_response: None,
         };
 
         Ok(router_data)
@@ -200,6 +201,7 @@ pub async fn decide_frm_flow(
         router_data,
         call_connector_action,
         None,
+        None,
     )
     .await
     .to_payment_failed_response()?;
diff --git a/crates/router/src/core/mandate.rs b/crates/router/src/core/mandate.rs
index a4dd1d2b198..e32709320c5 100644
--- a/crates/router/src/core/mandate.rs
+++ b/crates/router/src/core/mandate.rs
@@ -117,6 +117,7 @@ pub async fn revoke_mandate(
                 &router_data,
                 CallConnectorAction::Trigger,
                 None,
+                None,
             )
             .await
             .change_context(errors::ApiErrorResponse::InternalServerError)?;
diff --git a/crates/router/src/core/mandate/utils.rs b/crates/router/src/core/mandate/utils.rs
index 004666d7306..642a28c5671 100644
--- a/crates/router/src/core/mandate/utils.rs
+++ b/crates/router/src/core/mandate/utils.rs
@@ -85,6 +85,7 @@ pub async fn construct_mandate_revoke_router_data(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs
index 0b4590b2bec..c27ab57504b 100644
--- a/crates/router/src/core/payment_methods.rs
+++ b/crates/router/src/core/payment_methods.rs
@@ -2945,6 +2945,7 @@ async fn create_single_use_tokenization_flow(
             connector_mandate_request_reference_id: None,
             authentication_id: None,
             psd2_sca_exemption_type: None,
+            whole_connector_response: None,
         };
 
     let payment_method_token_response = tokenization::add_token_for_payment_method(
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index cb68ece2039..c69f22079b3 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -145,7 +145,7 @@ pub async fn payments_operation_core<F, Req, Op, FData, D>(
 ) -> RouterResult<(D, Req, Option<domain::Customer>, Option<u16>, Option<u128>)>
 where
     F: Send + Clone + Sync,
-    Req: Send + Sync,
+    Req: Send + Sync + Authenticate,
     Op: Operation<F, Req, Data = D> + Send + Sync,
     D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone,
 
@@ -213,6 +213,7 @@ where
                 profile,
                 false,
                 false, //should_retry_with_pan is set to false in case of PreDetermined ConnectorCallType
+                req.get_all_keys_required(),
             )
             .await?;
 
@@ -528,6 +529,7 @@ where
                         false,
                         false,
                         None,
+                        <Req as Authenticate>::get_all_keys_required(&req),
                     )
                     .await?;
 
@@ -651,6 +653,7 @@ where
                         false,
                         false,
                         routing_decision,
+                        <Req as Authenticate>::get_all_keys_required(&req),
                     )
                     .await?;
 
@@ -781,6 +784,7 @@ where
                         session_surcharge_details,
                         &business_profile,
                         header_payload.clone(),
+                        <Req as Authenticate>::get_all_keys_required(&req),
                     ))
                     .await?
                 }
@@ -909,6 +913,7 @@ pub async fn proxy_for_payments_operation_core<F, Req, Op, FData, D>(
     call_connector_action: CallConnectorAction,
     auth_flow: services::AuthFlow,
     header_payload: HeaderPayload,
+    all_keys_required: Option<bool>,
 ) -> RouterResult<(D, Req, Option<domain::Customer>, Option<u16>, Option<u128>)>
 where
     F: Send + Clone + Sync,
@@ -1022,6 +1027,7 @@ where
         schedule_time,
         header_payload.clone(),
         &business_profile,
+        all_keys_required,
     )
     .await?;
 
@@ -1107,10 +1113,11 @@ pub async fn proxy_for_payments_operation_core<F, Req, Op, FData, D>(
     get_tracker_response: operations::GetTrackerResponse<D>,
     call_connector_action: CallConnectorAction,
     header_payload: HeaderPayload,
+    all_keys_required: Option<bool>,
 ) -> RouterResult<(D, Req, Option<u16>, Option<u128>)>
 where
     F: Send + Clone + Sync,
-    Req: Send + Sync,
+    Req: Send + Sync + Authenticate,
     Op: Operation<F, Req, Data = D> + Send + Sync,
     D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone,
 
@@ -1151,6 +1158,7 @@ where
                 call_connector_action.clone(),
                 header_payload.clone(),
                 &profile,
+                all_keys_required,
             )
             .await?;
 
@@ -1624,6 +1632,7 @@ pub async fn proxy_for_payments_core<F, Res, Req, Op, FData, D>(
     auth_flow: services::AuthFlow,
     call_connector_action: CallConnectorAction,
     header_payload: HeaderPayload,
+    all_keys_required: Option<bool>,
 ) -> RouterResponse<Res>
 where
     F: Send + Clone + Sync,
@@ -1654,6 +1663,7 @@ where
             call_connector_action,
             auth_flow,
             header_payload.clone(),
+            all_keys_required,
         )
         .await?;
 
@@ -1682,10 +1692,11 @@ pub async fn proxy_for_payments_core<F, Res, Req, Op, FData, D>(
     payment_id: id_type::GlobalPaymentId,
     call_connector_action: CallConnectorAction,
     header_payload: HeaderPayload,
+    all_keys_required: Option<bool>,
 ) -> RouterResponse<Res>
 where
     F: Send + Clone + Sync,
-    Req: Send + Sync,
+    Req: Send + Sync + Authenticate,
     FData: Send + Sync + Clone,
     Op: Operation<F, Req, Data = D> + ValidateStatusForOperation + Send + Sync + Clone,
     Req: Debug,
@@ -1733,6 +1744,7 @@ where
             get_tracker_response,
             call_connector_action,
             header_payload.clone(),
+            all_keys_required,
         )
         .await?;
 
@@ -1819,6 +1831,7 @@ pub async fn record_attempt_core(
                 force_sync: true,
                 expand_attempts: false,
                 param: None,
+                all_keys_required: None,
             },
             operations::GetTrackerResponse {
                 payment_data: PaymentStatusData {
@@ -1832,6 +1845,7 @@ pub async fn record_attempt_core(
             },
             CallConnectorAction::Trigger,
             HeaderPayload::default(),
+            None,
         ))
         .await
         {
@@ -1999,7 +2013,7 @@ pub async fn payments_core<F, Res, Req, Op, FData, D>(
 ) -> RouterResponse<Res>
 where
     F: Send + Clone + Sync,
-    Req: Send + Sync,
+    Req: Send + Sync + Authenticate,
     FData: Send + Sync + Clone,
     Op: Operation<F, Req, Data = D> + ValidateStatusForOperation + Send + Sync + Clone,
     Req: Debug,
@@ -2555,6 +2569,7 @@ impl PaymentRedirectFlow for PaymentRedirectSync {
             client_secret: None,
             expand_attempts: None,
             expand_captures: None,
+            all_keys_required: None,
         };
         let response = Box::pin(
             payments_core::<api::PSync, api::PaymentsResponse, _, _, _, _>(
@@ -2687,6 +2702,7 @@ impl PaymentRedirectFlow for PaymentRedirectSync {
             param: Some(req.query_params.clone()),
             force_sync: true,
             expand_attempts: false,
+            all_keys_required: None,
         };
 
         let operation = operations::PaymentGet;
@@ -2931,6 +2947,7 @@ impl PaymentRedirectFlow for PaymentAuthenticateCompleteAuthorize {
                 client_secret: None,
                 expand_attempts: None,
                 expand_captures: None,
+                all_keys_required: None,
             };
             Box::pin(
                 payments_core::<api::PSync, api::PaymentsResponse, _, _, _, _>(
@@ -3069,6 +3086,7 @@ pub async fn call_connector_service<F, RouterDReq, ApiRequest, D>(
     is_retry_payment: bool,
     should_retry_with_pan: bool,
     routing_decision: Option<routing_helpers::RoutingDecisionData>,
+    all_keys_required: Option<bool>,
 ) -> RouterResult<(
     RouterData<F, RouterDReq, router_types::PaymentsResponseData>,
     helpers::MerchantConnectorAccountType,
@@ -3303,6 +3321,7 @@ where
                 connector_request,
                 business_profile,
                 header_payload.clone(),
+                all_keys_required,
             )
             .await
     } else {
@@ -3334,6 +3353,7 @@ pub async fn call_connector_service<F, RouterDReq, ApiRequest, D>(
     business_profile: &domain::Profile,
     is_retry_payment: bool,
     should_retry_with_pan: bool,
+    all_keys_required: Option<bool>,
 ) -> RouterResult<RouterData<F, RouterDReq, router_types::PaymentsResponseData>>
 where
     F: Send + Clone + Sync,
@@ -3450,6 +3470,7 @@ where
                 connector_request,
                 business_profile,
                 header_payload.clone(),
+                all_keys_required,
             )
             .await
     } else {
@@ -3481,6 +3502,7 @@ pub async fn proxy_for_call_connector_service<F, RouterDReq, ApiRequest, D>(
     header_payload: HeaderPayload,
 
     business_profile: &domain::Profile,
+    all_keys_required: Option<bool>,
 ) -> RouterResult<(
     RouterData<F, RouterDReq, router_types::PaymentsResponseData>,
     helpers::MerchantConnectorAccountType,
@@ -3621,6 +3643,7 @@ where
                 connector_request,
                 business_profile,
                 header_payload.clone(),
+                all_keys_required,
             )
             .await
     } else {
@@ -3647,6 +3670,7 @@ pub async fn proxy_for_call_connector_service<F, RouterDReq, ApiRequest, D>(
     call_connector_action: CallConnectorAction,
     header_payload: HeaderPayload,
     business_profile: &domain::Profile,
+    all_keys_required: Option<bool>,
 ) -> RouterResult<RouterData<F, RouterDReq, router_types::PaymentsResponseData>>
 where
     F: Send + Clone + Sync,
@@ -3742,6 +3766,7 @@ where
                 connector_request,
                 business_profile,
                 header_payload.clone(),
+                all_keys_required,
             )
             .await
     } else {
@@ -4003,6 +4028,7 @@ pub async fn call_multiple_connectors_service<F, Op, Req, D>(
     _session_surcharge_details: Option<api::SessionSurchargeDetails>,
     business_profile: &domain::Profile,
     header_payload: HeaderPayload,
+    all_keys_required: Option<bool>,
 ) -> RouterResult<D>
 where
     Op: Debug,
@@ -4059,6 +4085,7 @@ where
             None,
             business_profile,
             header_payload.clone(),
+            all_keys_required,
         );
 
         join_handlers.push(res);
@@ -4118,6 +4145,7 @@ pub async fn call_multiple_connectors_service<F, Op, Req, D>(
     session_surcharge_details: Option<api::SessionSurchargeDetails>,
     business_profile: &domain::Profile,
     header_payload: HeaderPayload,
+    all_keys_required: Option<bool>,
 ) -> RouterResult<D>
 where
     Op: Debug,
@@ -4179,6 +4207,7 @@ where
             None,
             business_profile,
             header_payload.clone(),
+            all_keys_required,
         );
 
         join_handlers.push(res);
@@ -5468,6 +5497,7 @@ where
     pub token_data: Option<storage::PaymentTokenData>,
     pub confirm: Option<bool>,
     pub force_sync: Option<bool>,
+    pub all_keys_required: Option<bool>,
     pub payment_method_data: Option<domain::PaymentMethodData>,
     pub payment_method_info: Option<domain::PaymentMethod>,
     pub refunds: Vec<storage::Refund>,
@@ -5498,6 +5528,7 @@ where
         Option<hyperswitch_domain_models::card_testing_guard_data::CardTestingGuardData>,
     pub vault_operation: Option<domain_payments::VaultOperation>,
     pub threeds_method_comp_ind: Option<api_models::payments::ThreeDsCompletionIndicator>,
+    pub whole_connector_response: Option<String>,
 }
 
 #[derive(Clone, serde::Serialize, Debug)]
@@ -5640,14 +5671,15 @@ where
                 .is_none()
         }
         "PaymentStatus" => {
-            matches!(
-                payment_data.get_payment_intent().status,
-                storage_enums::IntentStatus::Processing
-                    | storage_enums::IntentStatus::RequiresCustomerAction
-                    | storage_enums::IntentStatus::RequiresMerchantAction
-                    | storage_enums::IntentStatus::RequiresCapture
-                    | storage_enums::IntentStatus::PartiallyCapturedAndCapturable
-            ) && payment_data.get_force_sync().unwrap_or(false)
+            payment_data.get_all_keys_required().unwrap_or(false)
+                || matches!(
+                    payment_data.get_payment_intent().status,
+                    storage_enums::IntentStatus::Processing
+                        | storage_enums::IntentStatus::RequiresCustomerAction
+                        | storage_enums::IntentStatus::RequiresMerchantAction
+                        | storage_enums::IntentStatus::RequiresCapture
+                        | storage_enums::IntentStatus::PartiallyCapturedAndCapturable
+                ) && payment_data.get_force_sync().unwrap_or(false)
         }
         "PaymentCancel" => matches!(
             payment_data.get_payment_intent().status,
@@ -8113,11 +8145,13 @@ pub trait OperationSessionGetters<F> {
     fn get_token_data(&self) -> Option<&storage::PaymentTokenData>;
     fn get_mandate_connector(&self) -> Option<&MandateConnectorDetails>;
     fn get_force_sync(&self) -> Option<bool>;
+    fn get_all_keys_required(&self) -> Option<bool>;
     fn get_capture_method(&self) -> Option<enums::CaptureMethod>;
     fn get_merchant_connector_id_in_attempt(&self) -> Option<id_type::MerchantConnectorAccountId>;
 
     #[cfg(feature = "v1")]
     fn get_connector_customer_id(&self) -> Option<String>;
+    fn get_whole_connector_response(&self) -> Option<String>;
 
     #[cfg(feature = "v1")]
     fn get_vault_operation(&self) -> Option<&domain_payments::VaultOperation>;
@@ -8308,6 +8342,14 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentData<F> {
         self.force_sync
     }
 
+    fn get_all_keys_required(&self) -> Option<bool> {
+        self.all_keys_required
+    }
+
+    fn get_whole_connector_response(&self) -> Option<String> {
+        self.whole_connector_response.clone()
+    }
+
     #[cfg(feature = "v1")]
     fn get_capture_method(&self) -> Option<enums::CaptureMethod> {
         self.payment_attempt.capture_method
@@ -8607,6 +8649,14 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentIntentData<F> {
     fn get_optional_payment_attempt(&self) -> Option<&storage::PaymentAttempt> {
         todo!();
     }
+
+    fn get_all_keys_required(&self) -> Option<bool> {
+        todo!();
+    }
+
+    fn get_whole_connector_response(&self) -> Option<String> {
+        todo!();
+    }
 }
 
 #[cfg(feature = "v2")]
@@ -8842,6 +8892,14 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentConfirmData<F> {
     fn get_optional_payment_attempt(&self) -> Option<&storage::PaymentAttempt> {
         Some(&self.payment_attempt)
     }
+
+    fn get_all_keys_required(&self) -> Option<bool> {
+        todo!()
+    }
+
+    fn get_whole_connector_response(&self) -> Option<String> {
+        todo!()
+    }
 }
 
 #[cfg(feature = "v2")]
@@ -9078,6 +9136,14 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentStatusData<F> {
     fn get_optional_payment_attempt(&self) -> Option<&storage::PaymentAttempt> {
         self.payment_attempt.as_ref()
     }
+
+    fn get_all_keys_required(&self) -> Option<bool> {
+        todo!()
+    }
+
+    fn get_whole_connector_response(&self) -> Option<String> {
+        todo!()
+    }
 }
 
 #[cfg(feature = "v2")]
@@ -9315,6 +9381,14 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentCaptureData<F> {
     fn get_optional_payment_attempt(&self) -> Option<&storage::PaymentAttempt> {
         Some(&self.payment_attempt)
     }
+
+    fn get_all_keys_required(&self) -> Option<bool> {
+        todo!();
+    }
+
+    fn get_whole_connector_response(&self) -> Option<String> {
+        todo!();
+    }
 }
 
 #[cfg(feature = "v2")]
diff --git a/crates/router/src/core/payments/access_token.rs b/crates/router/src/core/payments/access_token.rs
index 53f7b3b4a40..f2f75964914 100644
--- a/crates/router/src/core/payments/access_token.rs
+++ b/crates/router/src/core/payments/access_token.rs
@@ -216,6 +216,7 @@ pub async fn refresh_connector_auth(
         router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await;
 
diff --git a/crates/router/src/core/payments/customers.rs b/crates/router/src/core/payments/customers.rs
index 83f01349787..c0767aaf204 100644
--- a/crates/router/src/core/payments/customers.rs
+++ b/crates/router/src/core/payments/customers.rs
@@ -48,6 +48,7 @@ pub async fn create_connector_customer<F: Clone, T: Clone>(
         &customer_router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs
index 2e4864c80ca..a27f3e0ce49 100644
--- a/crates/router/src/core/payments/flows.rs
+++ b/crates/router/src/core/payments/flows.rs
@@ -90,6 +90,7 @@ pub trait Feature<F, T> {
         connector_request: Option<services::Request>,
         business_profile: &domain::Profile,
         header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        all_keys_required: Option<bool>,
     ) -> RouterResult<Self>
     where
         Self: Sized,
@@ -753,6 +754,7 @@ pub async fn call_capture_request(
             connector_request,
             business_profile,
             header_payload.clone(),
+            None,
         )
         .await
 }
diff --git a/crates/router/src/core/payments/flows/approve_flow.rs b/crates/router/src/core/payments/flows/approve_flow.rs
index c63ad19742d..7c9bb5b4500 100644
--- a/crates/router/src/core/payments/flows/approve_flow.rs
+++ b/crates/router/src/core/payments/flows/approve_flow.rs
@@ -80,6 +80,7 @@ impl Feature<api::Approve, types::PaymentsApproveData>
         _connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         Err(ApiErrorResponse::NotImplemented {
             message: NotImplementedMessage::Reason("Flow not supported".to_string()),
diff --git a/crates/router/src/core/payments/flows/authorize_flow.rs b/crates/router/src/core/payments/flows/authorize_flow.rs
index d6489dab3bc..8c4a7a585b2 100644
--- a/crates/router/src/core/payments/flows/authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/authorize_flow.rs
@@ -170,6 +170,7 @@ impl Feature<api::Authorize, types::PaymentsAuthorizeData> for types::PaymentsAu
         connector_request: Option<services::Request>,
         business_profile: &domain::Profile,
         header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
             api::Authorize,
@@ -186,6 +187,7 @@ impl Feature<api::Authorize, types::PaymentsAuthorizeData> for types::PaymentsAu
                 &self,
                 call_connector_action.clone(),
                 connector_request,
+                all_keys_required,
             )
             .await
             .to_payment_failed_response()?;
@@ -262,6 +264,7 @@ impl Feature<api::Authorize, types::PaymentsAuthorizeData> for types::PaymentsAu
             authorize_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .to_payment_failed_response()?;
@@ -514,6 +517,7 @@ pub async fn authorize_preprocessing_steps<F: Clone>(
             &preprocessing_router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .to_payment_failed_response()?;
@@ -598,6 +602,7 @@ pub async fn authorize_postprocessing_steps<F: Clone>(
             &postprocessing_router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/cancel_flow.rs b/crates/router/src/core/payments/flows/cancel_flow.rs
index 3502e00e66b..e6eebba3127 100644
--- a/crates/router/src/core/payments/flows/cancel_flow.rs
+++ b/crates/router/src/core/payments/flows/cancel_flow.rs
@@ -79,6 +79,7 @@ impl Feature<api::Void, types::PaymentsCancelData>
         connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         metrics::PAYMENT_CANCEL_COUNT.add(
             1,
@@ -97,6 +98,7 @@ impl Feature<api::Void, types::PaymentsCancelData>
             &self,
             call_connector_action,
             connector_request,
+            None,
         )
         .await
         .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/capture_flow.rs b/crates/router/src/core/payments/flows/capture_flow.rs
index eb4c7ed0f53..9b681e107a2 100644
--- a/crates/router/src/core/payments/flows/capture_flow.rs
+++ b/crates/router/src/core/payments/flows/capture_flow.rs
@@ -108,6 +108,7 @@ impl Feature<api::Capture, types::PaymentsCaptureData>
         connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
             api::Capture,
@@ -121,6 +122,7 @@ impl Feature<api::Capture, types::PaymentsCaptureData>
             &self,
             call_connector_action,
             connector_request,
+            None,
         )
         .await
         .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/complete_authorize_flow.rs b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
index a2a6de43afa..768614b1304 100644
--- a/crates/router/src/core/payments/flows/complete_authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
@@ -100,6 +100,7 @@ impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData>
         connector_request: Option<services::Request>,
         business_profile: &domain::Profile,
         header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
             api::CompleteAuthorize,
@@ -113,6 +114,7 @@ impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData>
             &self,
             call_connector_action.clone(),
             connector_request,
+            None,
         )
         .await
         .to_payment_failed_response()?;
@@ -247,6 +249,7 @@ pub async fn complete_authorize_preprocessing_steps<F: Clone>(
             &preprocessing_router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/incremental_authorization_flow.rs b/crates/router/src/core/payments/flows/incremental_authorization_flow.rs
index df4897ef927..74419a5cfb3 100644
--- a/crates/router/src/core/payments/flows/incremental_authorization_flow.rs
+++ b/crates/router/src/core/payments/flows/incremental_authorization_flow.rs
@@ -87,6 +87,7 @@ impl Feature<api::IncrementalAuthorization, types::PaymentsIncrementalAuthorizat
         connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
             api::IncrementalAuthorization,
@@ -100,6 +101,7 @@ impl Feature<api::IncrementalAuthorization, types::PaymentsIncrementalAuthorizat
             &self,
             call_connector_action,
             connector_request,
+            None,
         )
         .await
         .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/post_session_tokens_flow.rs b/crates/router/src/core/payments/flows/post_session_tokens_flow.rs
index a374eae98e4..483d04e94df 100644
--- a/crates/router/src/core/payments/flows/post_session_tokens_flow.rs
+++ b/crates/router/src/core/payments/flows/post_session_tokens_flow.rs
@@ -87,6 +87,7 @@ impl Feature<api::PostSessionTokens, types::PaymentsPostSessionTokensData>
         connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
             api::PostSessionTokens,
@@ -100,6 +101,7 @@ impl Feature<api::PostSessionTokens, types::PaymentsPostSessionTokensData>
             &self,
             call_connector_action,
             connector_request,
+            None,
         )
         .await
         .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/psync_flow.rs b/crates/router/src/core/payments/flows/psync_flow.rs
index 58da60ed86f..de435d47b1d 100644
--- a/crates/router/src/core/payments/flows/psync_flow.rs
+++ b/crates/router/src/core/payments/flows/psync_flow.rs
@@ -111,6 +111,7 @@ impl Feature<api::PSync, types::PaymentsSyncData>
         connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
             api::PSync,
@@ -133,6 +134,7 @@ impl Feature<api::PSync, types::PaymentsSyncData>
                         pending_connector_capture_id_list,
                         call_connector_action,
                         connector_integration,
+                        all_keys_required,
                     )
                     .await?;
                 // Initiating Integrity checks
@@ -154,6 +156,7 @@ impl Feature<api::PSync, types::PaymentsSyncData>
                     &self,
                     call_connector_action,
                     connector_request,
+                    all_keys_required,
                 )
                 .await
                 .to_payment_failed_response()?;
@@ -238,6 +241,7 @@ where
             types::PaymentsSyncData,
             types::PaymentsResponseData,
         >,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self>;
 }
 
@@ -255,6 +259,7 @@ impl RouterDataPSync
             types::PaymentsSyncData,
             types::PaymentsResponseData,
         >,
+        all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let mut capture_sync_response_map = HashMap::new();
         if let payments::CallConnectorAction::HandleResponse(_) = call_connector_action {
@@ -265,6 +270,7 @@ impl RouterDataPSync
                 self,
                 call_connector_action.clone(),
                 None,
+                all_keys_required,
             )
             .await
             .to_payment_failed_response()?;
@@ -283,6 +289,7 @@ impl RouterDataPSync
                     &cloned_router_data,
                     call_connector_action.clone(),
                     None,
+                    all_keys_required,
                 )
                 .await
                 .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/reject_flow.rs b/crates/router/src/core/payments/flows/reject_flow.rs
index 9f49ebe1436..f333518db22 100644
--- a/crates/router/src/core/payments/flows/reject_flow.rs
+++ b/crates/router/src/core/payments/flows/reject_flow.rs
@@ -79,6 +79,7 @@ impl Feature<api::Reject, types::PaymentsRejectData>
         _connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         Err(ApiErrorResponse::NotImplemented {
             message: NotImplementedMessage::Reason("Flow not supported".to_string()),
diff --git a/crates/router/src/core/payments/flows/session_flow.rs b/crates/router/src/core/payments/flows/session_flow.rs
index 79c08ef2a3f..dcf424b4c88 100644
--- a/crates/router/src/core/payments/flows/session_flow.rs
+++ b/crates/router/src/core/payments/flows/session_flow.rs
@@ -121,6 +121,7 @@ impl Feature<api::Session, types::PaymentsSessionData> for types::PaymentsSessio
         _connector_request: Option<services::Request>,
         business_profile: &domain::Profile,
         header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         metrics::SESSION_TOKEN_CREATED.add(
             1,
@@ -1298,6 +1299,7 @@ impl RouterDataSession for types::PaymentsSessionRouterData {
                     self,
                     call_connector_action,
                     None,
+                    None,
                 )
                 .await
                 .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/session_update_flow.rs b/crates/router/src/core/payments/flows/session_update_flow.rs
index af78904e4ab..321f368199e 100644
--- a/crates/router/src/core/payments/flows/session_update_flow.rs
+++ b/crates/router/src/core/payments/flows/session_update_flow.rs
@@ -87,6 +87,7 @@ impl Feature<api::SdkSessionUpdate, types::SdkPaymentsSessionUpdateData>
         connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
             api::SdkSessionUpdate,
@@ -100,6 +101,7 @@ impl Feature<api::SdkSessionUpdate, types::SdkPaymentsSessionUpdateData>
             &self,
             call_connector_action,
             connector_request,
+            None,
         )
         .await
         .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/setup_mandate_flow.rs b/crates/router/src/core/payments/flows/setup_mandate_flow.rs
index 7ec5dc22d85..fa2f94873ac 100644
--- a/crates/router/src/core/payments/flows/setup_mandate_flow.rs
+++ b/crates/router/src/core/payments/flows/setup_mandate_flow.rs
@@ -116,6 +116,7 @@ impl Feature<api::SetupMandate, types::SetupMandateRequestData> for types::Setup
         connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        _all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
             api::SetupMandate,
@@ -143,6 +144,7 @@ impl Feature<api::SetupMandate, types::SetupMandateRequestData> for types::Setup
             &self,
             call_connector_action.clone(),
             connector_request,
+            None,
         )
         .await
         .to_setup_mandate_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/update_metadata_flow.rs b/crates/router/src/core/payments/flows/update_metadata_flow.rs
index f9a6790356a..85d942f52c7 100644
--- a/crates/router/src/core/payments/flows/update_metadata_flow.rs
+++ b/crates/router/src/core/payments/flows/update_metadata_flow.rs
@@ -86,6 +86,7 @@ impl Feature<api::UpdateMetadata, types::PaymentsUpdateMetadataData>
         connector_request: Option<services::Request>,
         _business_profile: &domain::Profile,
         _header_payload: hyperswitch_domain_models::payments::HeaderPayload,
+        all_keys_required: Option<bool>,
     ) -> RouterResult<Self> {
         let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
             api::UpdateMetadata,
@@ -99,6 +100,7 @@ impl Feature<api::UpdateMetadata, types::PaymentsUpdateMetadataData>
             &self,
             call_connector_action,
             connector_request,
+            all_keys_required,
         )
         .await
         .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 0cada8c368e..cce16ad6244 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -4170,6 +4170,7 @@ pub fn router_data_type_conversion<F1, F2, Req1, Req2, Res1, Res2>(
         connector_mandate_request_reference_id: router_data.connector_mandate_request_reference_id,
         authentication_id: router_data.authentication_id,
         psd2_sca_exemption_type: router_data.psd2_sca_exemption_type,
+        whole_connector_response: router_data.whole_connector_response,
     }
 }
 
diff --git a/crates/router/src/core/payments/operations/payment_approve.rs b/crates/router/src/core/payments/operations/payment_approve.rs
index a3b182dc3c4..a16c2cd433f 100644
--- a/crates/router/src/core/payments/operations/payment_approve.rs
+++ b/crates/router/src/core/payments/operations/payment_approve.rs
@@ -175,6 +175,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsCaptureR
             payment_method_data: None,
             payment_method_info: None,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -201,6 +202,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsCaptureR
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_cancel.rs b/crates/router/src/core/payments/operations/payment_cancel.rs
index fb0e7c70b27..343c1f98a9d 100644
--- a/crates/router/src/core/payments/operations/payment_cancel.rs
+++ b/crates/router/src/core/payments/operations/payment_cancel.rs
@@ -186,6 +186,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsCancelRe
             payment_method_data: None,
             payment_method_info: None,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -212,6 +213,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsCancelRe
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_capture.rs b/crates/router/src/core/payments/operations/payment_capture.rs
index 7ac984ae8ff..8e3a765b8ad 100644
--- a/crates/router/src/core/payments/operations/payment_capture.rs
+++ b/crates/router/src/core/payments/operations/payment_capture.rs
@@ -218,6 +218,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, payments::PaymentData<F>, api::Paymen
             payment_attempt,
             currency,
             force_sync: None,
+            all_keys_required: None,
             amount,
             email: None,
             mandate_id: None,
@@ -261,6 +262,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, payments::PaymentData<F>, api::Paymen
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_complete_authorize.rs b/crates/router/src/core/payments/operations/payment_complete_authorize.rs
index 1ec62d84a51..199b4faf629 100644
--- a/crates/router/src/core/payments/operations/payment_complete_authorize.rs
+++ b/crates/router/src/core/payments/operations/payment_complete_authorize.rs
@@ -340,6 +340,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
                 .and_then(|pmd| pmd.payment_method_data.clone().map(Into::into)),
             payment_method_info,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -366,6 +367,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: request.threeds_method_comp_ind.clone(),
+            whole_connector_response: None,
         };
 
         let customer_details = Some(CustomerDetails {
diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs
index a99359d7ea2..8c5f72b3405 100644
--- a/crates/router/src/core/payments/operations/payment_confirm.rs
+++ b/crates/router/src/core/payments/operations/payment_confirm.rs
@@ -798,6 +798,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
             payment_method_data: payment_method_data_after_card_bin_call.map(Into::into),
             payment_method_info,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -824,6 +825,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs
index fc781e1350f..8ba549c59aa 100644
--- a/crates/router/src/core/payments/operations/payment_create.rs
+++ b/crates/router/src/core/payments/operations/payment_create.rs
@@ -601,6 +601,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
             disputes: vec![],
             attempts: None,
             force_sync: None,
+            all_keys_required: None,
             sessions_token: vec![],
             card_cvc: request.card_cvc.clone(),
             creds_identifier,
@@ -624,6 +625,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
@@ -736,6 +738,7 @@ impl<F: Clone + Send + Sync> Domain<F, api::PaymentsRequest, PaymentData<F>> for
                 &router_data,
                 payments::CallConnectorAction::Trigger,
                 None,
+                None,
             )
             .await
             .change_context(errors::ApiErrorResponse::InternalServerError)
diff --git a/crates/router/src/core/payments/operations/payment_post_session_tokens.rs b/crates/router/src/core/payments/operations/payment_post_session_tokens.rs
index d8904d2c930..3df1da1827e 100644
--- a/crates/router/src/core/payments/operations/payment_post_session_tokens.rs
+++ b/crates/router/src/core/payments/operations/payment_post_session_tokens.rs
@@ -147,6 +147,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsPostSess
             payment_method_data: None,
             payment_method_info: None,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -173,6 +174,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsPostSess
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
         let get_trackers_response = operations::GetTrackerResponse {
             operation: Box::new(self),
diff --git a/crates/router/src/core/payments/operations/payment_reject.rs b/crates/router/src/core/payments/operations/payment_reject.rs
index 27557afa53e..33ec9a0d592 100644
--- a/crates/router/src/core/payments/operations/payment_reject.rs
+++ b/crates/router/src/core/payments/operations/payment_reject.rs
@@ -173,6 +173,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, PaymentsCancelRequest
             payment_method_data: None,
             payment_method_info: None,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -199,6 +200,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, PaymentsCancelRequest
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs
index 0b182d249bd..57d83f0d0c4 100644
--- a/crates/router/src/core/payments/operations/payment_response.rs
+++ b/crates/router/src/core/payments/operations/payment_response.rs
@@ -1406,6 +1406,7 @@ async fn payment_response_update_tracker<F: Clone, T: types::Capturable>(
             .as_mut()
             .map(|info| info.status = status)
     });
+    payment_data.whole_connector_response = router_data.whole_connector_response.clone();
 
     // TODO: refactor of gsm_error_category with respective feature flag
     #[allow(unused_variables)]
diff --git a/crates/router/src/core/payments/operations/payment_session.rs b/crates/router/src/core/payments/operations/payment_session.rs
index e105ed69ba9..b0a5f2fc133 100644
--- a/crates/router/src/core/payments/operations/payment_session.rs
+++ b/crates/router/src/core/payments/operations/payment_session.rs
@@ -195,6 +195,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsSessionR
             payment_method_data: None,
             payment_method_info: None,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -221,6 +222,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsSessionR
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_start.rs b/crates/router/src/core/payments/operations/payment_start.rs
index 429a1128b71..e702ba1ef50 100644
--- a/crates/router/src/core/payments/operations/payment_start.rs
+++ b/crates/router/src/core/payments/operations/payment_start.rs
@@ -183,6 +183,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsStartReq
             payment_method_data: None,
             payment_method_info: None,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -209,6 +210,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsStartReq
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rs
index 58c784c6528..c6cf1f96fef 100644
--- a/crates/router/src/core/payments/operations/payment_status.rs
+++ b/crates/router/src/core/payments/operations/payment_status.rs
@@ -524,6 +524,7 @@ async fn get_tracker_for_sync<
                 && (helpers::check_force_psync_precondition(payment_attempt.status)
                     || contains_encoded_data),
         ),
+        all_keys_required: request.all_keys_required,
         payment_attempt,
         refunds,
         disputes,
@@ -551,6 +552,7 @@ async fn get_tracker_for_sync<
         card_testing_guard_data: None,
         vault_operation: None,
         threeds_method_comp_ind: None,
+        whole_connector_response: None,
     };
 
     let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs
index 0f3a58d9b9a..4a212962986 100644
--- a/crates/router/src/core/payments/operations/payment_update.rs
+++ b/crates/router/src/core/payments/operations/payment_update.rs
@@ -477,6 +477,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
                 .and_then(|pmd| pmd.payment_method_data.clone().map(Into::into)),
             payment_method_info,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -503,6 +504,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest>
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
@@ -614,6 +616,7 @@ impl<F: Clone + Send + Sync> Domain<F, api::PaymentsRequest, PaymentData<F>> for
                 &router_data,
                 payments::CallConnectorAction::Trigger,
                 None,
+                None,
             )
             .await
             .change_context(errors::ApiErrorResponse::InternalServerError)
diff --git a/crates/router/src/core/payments/operations/payment_update_metadata.rs b/crates/router/src/core/payments/operations/payment_update_metadata.rs
index d35b0b4044b..2c6841c44a4 100644
--- a/crates/router/src/core/payments/operations/payment_update_metadata.rs
+++ b/crates/router/src/core/payments/operations/payment_update_metadata.rs
@@ -133,6 +133,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsUpdateMe
             payment_method_data: None,
             payment_method_info: None,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -159,6 +160,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsUpdateMe
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
         let get_trackers_response = operations::GetTrackerResponse {
             operation: Box::new(self),
diff --git a/crates/router/src/core/payments/operations/payments_incremental_authorization.rs b/crates/router/src/core/payments/operations/payments_incremental_authorization.rs
index 662b32699d9..e5262d092c1 100644
--- a/crates/router/src/core/payments/operations/payments_incremental_authorization.rs
+++ b/crates/router/src/core/payments/operations/payments_incremental_authorization.rs
@@ -147,6 +147,7 @@ impl<F: Send + Clone + Sync>
             payment_method_data: None,
             payment_method_info: None,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -178,6 +179,7 @@ impl<F: Send + Clone + Sync>
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
 
         let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/tax_calculation.rs b/crates/router/src/core/payments/operations/tax_calculation.rs
index 2a261da467d..85ad5fb1cb6 100644
--- a/crates/router/src/core/payments/operations/tax_calculation.rs
+++ b/crates/router/src/core/payments/operations/tax_calculation.rs
@@ -162,6 +162,7 @@ impl<F: Send + Clone + Sync>
             payment_method_data: None,
             payment_method_info: None,
             force_sync: None,
+            all_keys_required: None,
             refunds: vec![],
             disputes: vec![],
             attempts: None,
@@ -188,6 +189,7 @@ impl<F: Send + Clone + Sync>
             card_testing_guard_data: None,
             vault_operation: None,
             threeds_method_comp_ind: None,
+            whole_connector_response: None,
         };
         let get_trackers_response = operations::GetTrackerResponse {
             operation: Box::new(self),
@@ -296,6 +298,7 @@ impl<F: Clone + Send + Sync> Domain<F, api::PaymentsDynamicTaxCalculationRequest
                 &router_data,
                 payments::CallConnectorAction::Trigger,
                 None,
+                None,
             )
             .await
             .to_payment_failed_response()
diff --git a/crates/router/src/core/payments/retry.rs b/crates/router/src/core/payments/retry.rs
index bfe2c99855e..241a189d68d 100644
--- a/crates/router/src/core/payments/retry.rs
+++ b/crates/router/src/core/payments/retry.rs
@@ -373,6 +373,7 @@ where
         true,
         should_retry_with_pan,
         None,
+        None,
     )
     .await?;
 
diff --git a/crates/router/src/core/payments/session_operation.rs b/crates/router/src/core/payments/session_operation.rs
index 4c3d27b72ec..d018ac19107 100644
--- a/crates/router/src/core/payments/session_operation.rs
+++ b/crates/router/src/core/payments/session_operation.rs
@@ -185,6 +185,7 @@ where
                 None,
                 &profile,
                 header_payload.clone(),
+                None,
             ))
             .await?
         }
diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rs
index ae68ea53773..5d878b54bf3 100644
--- a/crates/router/src/core/payments/tokenization.rs
+++ b/crates/router/src/core/payments/tokenization.rs
@@ -1174,6 +1174,7 @@ pub async fn add_payment_method_token<F: Clone, T: types::Tokenizable + Clone>(
                     &pm_token_router_data,
                     payments::CallConnectorAction::Trigger,
                     None,
+                    None,
                 )
                 .await
                 .to_payment_failed_response()?;
@@ -1431,6 +1432,7 @@ pub async fn add_token_for_payment_method(
         &payment_method_token_router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index 7e715d40ce6..a8c6417e806 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -169,6 +169,7 @@ where
         connector_mandate_request_reference_id,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
     Ok(router_data)
 }
@@ -388,6 +389,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(
         connector_mandate_request_reference_id,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -550,6 +552,7 @@ pub async fn construct_payment_router_data_for_capture<'a>(
         connector_mandate_request_reference_id,
         psd2_sca_exemption_type: None,
         authentication_id: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -677,6 +680,7 @@ pub async fn construct_router_data_for_psync<'a>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -837,6 +841,7 @@ pub async fn construct_payment_router_data_for_sdk_session<'a>(
         connector_mandate_request_reference_id: None,
         psd2_sca_exemption_type: None,
         authentication_id: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -1044,6 +1049,7 @@ pub async fn construct_payment_router_data_for_setup_mandate<'a>(
         connector_mandate_request_reference_id,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -1242,6 +1248,7 @@ where
         connector_mandate_request_reference_id,
         authentication_id: None,
         psd2_sca_exemption_type: payment_data.payment_intent.psd2_sca_exemption_type,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -1431,6 +1438,7 @@ pub async fn construct_payment_router_data_for_update_metadata<'a>(
         connector_mandate_request_reference_id,
         authentication_id: None,
         psd2_sca_exemption_type: payment_data.payment_intent.psd2_sca_exemption_type,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -2870,6 +2878,7 @@ where
             issuer_error_code: payment_attempt.issuer_error_code,
             issuer_error_message: payment_attempt.issuer_error_message,
             is_iframe_redirection_enabled: payment_intent.is_iframe_redirection_enabled,
+            whole_connector_response: payment_data.get_whole_connector_response(),
         };
 
         services::ApplicationResponse::JsonWithHeaders((payments_response, headers))
@@ -3160,6 +3169,7 @@ impl ForeignFrom<(storage::PaymentIntent, storage::PaymentAttempt)> for api::Pay
             card_discovery: pa.card_discovery,
             force_3ds_challenge: pi.force_3ds_challenge,
             force_3ds_challenge_trigger: pi.force_3ds_challenge_trigger,
+            whole_connector_response: None,
             issuer_error_code: pa.issuer_error_code,
             issuer_error_message: pa.issuer_error_message,
             is_iframe_redirection_enabled:pi.is_iframe_redirection_enabled
diff --git a/crates/router/src/core/payouts.rs b/crates/router/src/core/payouts.rs
index 87888ab4257..ebc462d286d 100644
--- a/crates/router/src/core/payouts.rs
+++ b/crates/router/src/core/payouts.rs
@@ -1205,6 +1205,7 @@ pub async fn create_recipient(
             &router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .to_payout_failed_response()?;
@@ -1432,6 +1433,7 @@ pub async fn check_payout_eligibility(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payout_failed_response()?;
@@ -1647,6 +1649,7 @@ pub async fn create_payout(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payout_failed_response()?;
@@ -1775,6 +1778,7 @@ async fn complete_payout_quote_steps_if_required<F>(
             &quote_router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .to_payout_failed_response()?;
@@ -1867,6 +1871,7 @@ pub async fn create_payout_retrieve(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payout_failed_response()?;
@@ -2027,6 +2032,7 @@ pub async fn create_recipient_disburse_account(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payout_failed_response()?;
@@ -2216,6 +2222,7 @@ pub async fn cancel_payout(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payout_failed_response()?;
@@ -2353,6 +2360,7 @@ pub async fn fulfill_payout(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payout_failed_response()?;
diff --git a/crates/router/src/core/payouts/access_token.rs b/crates/router/src/core/payouts/access_token.rs
index 27fc2e85536..a675b5f4e35 100644
--- a/crates/router/src/core/payouts/access_token.rs
+++ b/crates/router/src/core/payouts/access_token.rs
@@ -155,6 +155,7 @@ pub async fn refresh_connector_auth(
         router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await;
 
diff --git a/crates/router/src/core/refunds.rs b/crates/router/src/core/refunds.rs
index 0e3814107ab..b9c9e497f6d 100644
--- a/crates/router/src/core/refunds.rs
+++ b/crates/router/src/core/refunds.rs
@@ -214,6 +214,7 @@ pub async fn trigger_refund_to_gateway(
             &router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await;
         let option_refund_error_update =
@@ -647,6 +648,7 @@ pub async fn sync_refund_with_gateway(
             &router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .to_refund_failed_response()?;
diff --git a/crates/router/src/core/refunds_v2.rs b/crates/router/src/core/refunds_v2.rs
index ee10e1b3081..922b9dce245 100644
--- a/crates/router/src/core/refunds_v2.rs
+++ b/crates/router/src/core/refunds_v2.rs
@@ -240,6 +240,7 @@ where
             &router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
     } else {
diff --git a/crates/router/src/core/relay.rs b/crates/router/src/core/relay.rs
index 5aae99849c9..e3f029ecb51 100644
--- a/crates/router/src/core/relay.rs
+++ b/crates/router/src/core/relay.rs
@@ -160,6 +160,7 @@ impl RelayInterface for RelayRefund {
             &router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .to_refund_failed_response()?;
@@ -463,6 +464,7 @@ pub async fn sync_relay_refund_with_gateway(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_refund_failed_response()?;
diff --git a/crates/router/src/core/relay/utils.rs b/crates/router/src/core/relay/utils.rs
index a473d0c20d6..effc2178ec3 100644
--- a/crates/router/src/core/relay/utils.rs
+++ b/crates/router/src/core/relay/utils.rs
@@ -143,6 +143,7 @@ pub async fn construct_relay_refund_router_data<F>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
diff --git a/crates/router/src/core/revenue_recovery/api.rs b/crates/router/src/core/revenue_recovery/api.rs
index ed0d2e250f9..60465964856 100644
--- a/crates/router/src/core/revenue_recovery/api.rs
+++ b/crates/router/src/core/revenue_recovery/api.rs
@@ -31,6 +31,7 @@ pub async fn call_psync_api(
         force_sync: false,
         param: None,
         expand_attempts: true,
+        all_keys_required: None,
     };
     let merchant_context_from_revenue_recovery_data =
         MerchantContext::NormalMerchant(Box::new(Context(
@@ -128,6 +129,7 @@ pub async fn call_proxy_api(
         get_tracker_response,
         payments::CallConnectorAction::Trigger,
         payments_domain::HeaderPayload::default(),
+        None,
     ))
     .await?;
     Ok(payment_data)
diff --git a/crates/router/src/core/revenue_recovery/types.rs b/crates/router/src/core/revenue_recovery/types.rs
index 8b30011e022..e551340e102 100644
--- a/crates/router/src/core/revenue_recovery/types.rs
+++ b/crates/router/src/core/revenue_recovery/types.rs
@@ -736,6 +736,7 @@ async fn record_back_to_billing_connector(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .change_context(errors::RecoveryError::RecordBackToBillingConnectorFailed)
diff --git a/crates/router/src/core/unified_authentication_service/utils.rs b/crates/router/src/core/unified_authentication_service/utils.rs
index cbd4c2ee2ea..bab5d412357 100644
--- a/crates/router/src/core/unified_authentication_service/utils.rs
+++ b/crates/router/src/core/unified_authentication_service/utils.rs
@@ -48,6 +48,7 @@ where
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .to_payment_failed_response()?;
@@ -121,6 +122,7 @@ pub fn construct_uas_router_data<F: Clone, Req, Res>(
         connector_mandate_request_reference_id: None,
         authentication_id,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     })
 }
 
diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs
index 7b88998953f..3d67c5e4655 100644
--- a/crates/router/src/core/utils.rs
+++ b/crates/router/src/core/utils.rs
@@ -228,6 +228,7 @@ pub async fn construct_payout_router_data<'a, F>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -383,6 +384,7 @@ pub async fn construct_refund_router_data<'a, F>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -585,6 +587,7 @@ pub async fn construct_refund_router_data<'a, F>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
 
     Ok(router_data)
@@ -1025,6 +1028,7 @@ pub async fn construct_accept_dispute_router_data<'a>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
     Ok(router_data)
 }
@@ -1122,6 +1126,7 @@ pub async fn construct_submit_evidence_router_data<'a>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
     Ok(router_data)
 }
@@ -1225,6 +1230,7 @@ pub async fn construct_upload_file_router_data<'a>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
     Ok(router_data)
 }
@@ -1347,6 +1353,7 @@ pub async fn construct_payments_dynamic_tax_calculation_router_data<F: Clone>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
     Ok(router_data)
 }
@@ -1447,6 +1454,7 @@ pub async fn construct_defend_dispute_router_data<'a>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
     Ok(router_data)
 }
@@ -1541,6 +1549,7 @@ pub async fn construct_retrieve_file_router_data<'a>(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
     Ok(router_data)
 }
diff --git a/crates/router/src/core/webhooks/incoming.rs b/crates/router/src/core/webhooks/incoming.rs
index 86769b393ca..f50308d932c 100644
--- a/crates/router/src/core/webhooks/incoming.rs
+++ b/crates/router/src/core/webhooks/incoming.rs
@@ -659,6 +659,7 @@ async fn payments_incoming_webhook_flow(
                     client_secret: None,
                     expand_attempts: None,
                     expand_captures: None,
+                    all_keys_required: None,
                 },
                 services::AuthFlow::Merchant,
                 consume_or_trigger_flow.clone(),
@@ -1843,6 +1844,7 @@ async fn verify_webhook_source_verification_call(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await?;
 
diff --git a/crates/router/src/core/webhooks/incoming_v2.rs b/crates/router/src/core/webhooks/incoming_v2.rs
index 94fec01edfa..b4ac1fbc805 100644
--- a/crates/router/src/core/webhooks/incoming_v2.rs
+++ b/crates/router/src/core/webhooks/incoming_v2.rs
@@ -470,6 +470,7 @@ async fn payments_incoming_webhook_flow(
                         force_sync: true,
                         expand_attempts: false,
                         param: None,
+                        all_keys_required: None,
                     },
                     get_trackers_response,
                     consume_or_trigger_flow,
@@ -727,6 +728,7 @@ async fn verify_webhook_source_verification_call(
         &router_data,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await?;
 
diff --git a/crates/router/src/core/webhooks/recovery_incoming.rs b/crates/router/src/core/webhooks/recovery_incoming.rs
index 89341614d9c..79994a48e85 100644
--- a/crates/router/src/core/webhooks/recovery_incoming.rs
+++ b/crates/router/src/core/webhooks/recovery_incoming.rs
@@ -433,6 +433,7 @@ impl RevenueRecoveryAttempt {
                 force_sync: false,
                 expand_attempts: true,
                 param: None,
+                all_keys_required: None,
             },
             payment_intent.payment_id.clone(),
             payments::CallConnectorAction::Avoid,
@@ -811,6 +812,7 @@ impl BillingConnectorPaymentsSyncResponseData {
             &router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .change_context(errors::RevenueRecoveryError::BillingConnectorPaymentsSyncFailed)
@@ -979,6 +981,7 @@ impl BillingConnectorInvoiceSyncResponseData {
             &router_data,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .change_context(errors::RevenueRecoveryError::BillingConnectorInvoiceSyncFailed)
diff --git a/crates/router/src/core/webhooks/utils.rs b/crates/router/src/core/webhooks/utils.rs
index 155a21b4d25..4cf0d784a05 100644
--- a/crates/router/src/core/webhooks/utils.rs
+++ b/crates/router/src/core/webhooks/utils.rs
@@ -133,6 +133,7 @@ pub async fn construct_webhook_router_data(
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     };
     Ok(router_data)
 }
diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rs
index 6af6a7af6e3..3ea5049742d 100644
--- a/crates/router/src/routes/payments.rs
+++ b/crates/router/src/routes/payments.rs
@@ -428,6 +428,7 @@ pub async fn payments_retrieve(
         client_secret: json_payload.client_secret.clone(),
         expand_attempts: json_payload.expand_attempts,
         expand_captures: json_payload.expand_captures,
+        all_keys_required: json_payload.all_keys_required,
         ..Default::default()
     };
     let header_payload = match HeaderPayload::foreign_try_from(req.headers()) {
@@ -1903,10 +1904,11 @@ where
             merchant_context,
             profile_id,
             operation,
-            req,
+            req.clone(),
             auth_flow,
             payments::CallConnectorAction::Trigger,
             header_payload,
+            req.all_keys_required,
         )
         .await
     } else {
@@ -2812,6 +2814,7 @@ pub async fn proxy_confirm_intent(
                 payment_id,
                 payments::CallConnectorAction::Trigger,
                 header_payload.clone(),
+                None,
             ))
         },
         &auth::V2ApiKeyAuth {
diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs
index 4bc57cfdaa8..54384e107a2 100644
--- a/crates/router/src/services/api.rs
+++ b/crates/router/src/services/api.rs
@@ -140,6 +140,7 @@ pub async fn execute_connector_processing_step<
     req: &'b types::RouterData<T, Req, Resp>,
     call_connector_action: payments::CallConnectorAction,
     connector_request: Option<Request>,
+    all_keys_required: Option<bool>,
 ) -> CustomResult<types::RouterData<T, Req, Resp>, errors::ConnectorError>
 where
     T: Clone + Debug + 'static,
@@ -272,7 +273,7 @@ where
                                 Ok(body) => {
                                     let connector_http_status_code = Some(body.status_code);
                                     let handle_response_result = connector_integration
-                                        .handle_response(req, Some(&mut connector_event), body)
+                                        .handle_response(req, Some(&mut connector_event), body.clone())
                                         .inspect_err(|error| {
                                             if error.current_context()
                                             == &errors::ConnectorError::ResponseDeserializationFailed
@@ -299,6 +300,16 @@ where
                                                         val + external_latency
                                                     }),
                                             );
+                                            if all_keys_required == Some(true) {
+                                                let mut decoded = String::from_utf8(body.response.as_ref().to_vec())
+                                                    .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+                                                if decoded.starts_with('\u{feff}') {
+                                                    decoded = decoded
+                                                        .trim_start_matches('\u{feff}')
+                                                        .to_string();
+                                                }
+                                                data.whole_connector_response = Some(decoded);
+                                            }
                                             Ok(data)
                                         }
                                         Err(err) => {
@@ -1061,13 +1072,26 @@ pub trait Authenticate {
     fn get_client_secret(&self) -> Option<&String> {
         None
     }
+
+    fn get_all_keys_required(&self) -> Option<bool> {
+        None
+    }
 }
 
+#[cfg(feature = "v2")]
+impl Authenticate for api_models::payments::PaymentsConfirmIntentRequest {}
+#[cfg(feature = "v2")]
+impl Authenticate for api_models::payments::ProxyPaymentsRequest {}
+
 #[cfg(feature = "v1")]
 impl Authenticate for api_models::payments::PaymentsRequest {
     fn get_client_secret(&self) -> Option<&String> {
         self.client_secret.as_ref()
     }
+
+    fn get_all_keys_required(&self) -> Option<bool> {
+        self.all_keys_required
+    }
 }
 
 impl Authenticate for api_models::payment_methods::PaymentMethodListRequest {
@@ -1095,7 +1119,11 @@ impl Authenticate for api_models::payments::PaymentsPostSessionTokensRequest {
 }
 
 impl Authenticate for api_models::payments::PaymentsUpdateMetadataRequest {}
-impl Authenticate for api_models::payments::PaymentsRetrieveRequest {}
+impl Authenticate for api_models::payments::PaymentsRetrieveRequest {
+    fn get_all_keys_required(&self) -> Option<bool> {
+        self.all_keys_required
+    }
+}
 impl Authenticate for api_models::payments::PaymentsCancelRequest {}
 impl Authenticate for api_models::payments::PaymentsCaptureRequest {}
 impl Authenticate for api_models::payments::PaymentsIncrementalAuthorizationRequest {}
diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs
index af5d983a48a..0c1255850a3 100644
--- a/crates/router/src/types.rs
+++ b/crates/router/src/types.rs
@@ -976,6 +976,7 @@ impl<F1, F2, T1, T2> ForeignFrom<(&RouterData<F1, T1, PaymentsResponseData>, T2)
                 .clone(),
             authentication_id: data.authentication_id.clone(),
             psd2_sca_exemption_type: data.psd2_sca_exemption_type,
+            whole_connector_response: data.whole_connector_response.clone(),
         }
     }
 }
@@ -1043,6 +1044,7 @@ impl<F1, F2>
             psd2_sca_exemption_type: None,
             additional_merchant_data: data.additional_merchant_data.clone(),
             connector_mandate_request_reference_id: None,
+            whole_connector_response: None,
         }
     }
 }
diff --git a/crates/router/src/types/api/verify_connector.rs b/crates/router/src/types/api/verify_connector.rs
index 223c3e5638d..ad9a490398a 100644
--- a/crates/router/src/types/api/verify_connector.rs
+++ b/crates/router/src/types/api/verify_connector.rs
@@ -126,6 +126,7 @@ impl VerifyConnectorData {
             connector_mandate_request_reference_id: None,
             authentication_id: None,
             psd2_sca_exemption_type: None,
+            whole_connector_response: None,
         }
     }
 }
diff --git a/crates/router/tests/connectors/aci.rs b/crates/router/tests/connectors/aci.rs
index 3497a048a8a..61272a05877 100644
--- a/crates/router/tests/connectors/aci.rs
+++ b/crates/router/tests/connectors/aci.rs
@@ -133,6 +133,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData {
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     }
 }
 
@@ -205,6 +206,7 @@ fn construct_refund_router_data<F>() -> types::RefundsRouterData<F> {
         connector_mandate_request_reference_id: None,
         authentication_id: None,
         psd2_sca_exemption_type: None,
+        whole_connector_response: None,
     }
 }
 
@@ -247,6 +249,7 @@ async fn payments_create_success() {
         &request,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .unwrap();
@@ -312,6 +315,7 @@ async fn payments_create_failure() {
             &request,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await
         .is_err();
@@ -358,6 +362,7 @@ async fn refund_for_successful_payments() {
         &request,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .unwrap();
@@ -383,6 +388,7 @@ async fn refund_for_successful_payments() {
         &refund_request,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .unwrap();
@@ -433,6 +439,7 @@ async fn refunds_create_failure() {
         &request,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
     .is_err();
diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs
index d6925ae1667..543d2451140 100644
--- a/crates/router/tests/connectors/utils.rs
+++ b/crates/router/tests/connectors/utils.rs
@@ -556,6 +556,7 @@ pub trait ConnectorActions: Connector {
             connector_mandate_request_reference_id: None,
             psd2_sca_exemption_type: None,
             authentication_id: None,
+            whole_connector_response: None,
         }
     }
 
@@ -620,6 +621,7 @@ pub trait ConnectorActions: Connector {
             &request,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await?;
         Ok(res.response.unwrap())
@@ -664,6 +666,7 @@ pub trait ConnectorActions: Connector {
             &request,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await?;
         Ok(res.response.unwrap())
@@ -709,6 +712,7 @@ pub trait ConnectorActions: Connector {
             &request,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await?;
         Ok(res.response.unwrap())
@@ -753,6 +757,7 @@ pub trait ConnectorActions: Connector {
             &request,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await?;
         Ok(res.response.unwrap())
@@ -848,6 +853,7 @@ pub trait ConnectorActions: Connector {
             &request,
             payments::CallConnectorAction::Trigger,
             None,
+            None,
         )
         .await?;
         Ok(res.response.unwrap())
@@ -889,6 +895,7 @@ async fn call_connector<
         &request,
         payments::CallConnectorAction::Trigger,
         None,
+        None,
     )
     .await
 }
diff --git a/crates/router/tests/payments.rs b/crates/router/tests/payments.rs
index 82296d2a83b..1879af550f1 100644
--- a/crates/router/tests/payments.rs
+++ b/crates/router/tests/payments.rs
@@ -464,6 +464,7 @@ async fn payments_create_core() {
         issuer_error_code: None,
         issuer_error_message: None,
         is_iframe_redirection_enabled: None,
+        whole_connector_response: None,
     };
     let expected_response =
         services::ApplicationResponse::JsonWithHeaders((expected_response, vec![]));
@@ -741,6 +742,7 @@ async fn payments_create_core_adyen_no_redirect() {
             issuer_error_code: None,
             issuer_error_message: None,
             is_iframe_redirection_enabled: None,
+            whole_connector_response: None,
         },
         vec![],
     ));
diff --git a/crates/router/tests/payments2.rs b/crates/router/tests/payments2.rs
index 1240d1c17a2..e7aaa09f5b8 100644
--- a/crates/router/tests/payments2.rs
+++ b/crates/router/tests/payments2.rs
@@ -226,6 +226,7 @@ async fn payments_create_core() {
         issuer_error_code: None,
         issuer_error_message: None,
         is_iframe_redirection_enabled: None,
+        whole_connector_response: None,
     };
 
     let expected_response =
@@ -511,6 +512,7 @@ async fn payments_create_core_adyen_no_redirect() {
             issuer_error_code: None,
             issuer_error_message: None,
             is_iframe_redirection_enabled: None,
+            whole_connector_response: None,
         },
         vec![],
     ));

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

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

closes this [issue](https://github.com/juspay/hyperswitch/issues/7997)

## Description
<!-- Describe your changes in detail -->

Added all_keys_required in confirm and psync payload. If all_keys_required is passed as true, we will send the whole connector response.

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

Postman Test

Confirm call (with `all_keys_required` passed as `true`)

Request (taking AuthorizeDotNet as connector)

```
curl --location 'http://localhost:8080/payments/pay_MsmPKoZNKAk0zpoBuA5Z/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'all_keys_required: true' \
--header 'api-key: ••••••' \
--data '
{
    "connector": ["authorizedotnet"],
    "all_keys_required": true,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "370000000000002",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    }
}
'
```

Response:

```
{
    "payment_id": "pay_UHNVQh54xvuv97CixQVF",
    "merchant_id": "merchant_1746796056",
    "status": "succeeded",
    "amount": 35308,
    "net_amount": 35308,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 35308,
    "connector": "authorizedotnet",
    "client_secret": "pay_UHNVQh54xvuv97CixQVF_secret_aUvQnXDaU6Op4uFuWHC1",
    "created": "2025-05-09T13:08:19.469Z",
    "currency": "USD",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0000",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "491761",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_xZJ3bAv0dVvWBWpuYRga",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": null,
    "authentication_type": "three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "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": "80040892370",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "80040892370",
    "payment_link": null,
    "profile_id": "pro_NLQkgFo4oL87ujOInwp1",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_Bjt7NDYXrZmazh9Tdavu",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-09T13:23:19.469Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": null,
        "language": null,
        "time_zone": null,
        "ip_address": "::1",
        "os_version": null,
        "user_agent": null,
        "color_depth": null,
        "device_model": null,
        "java_enabled": null,
        "screen_width": null,
        "accept_header": null,
        "screen_height": null,
        "accept_language": "en",
        "java_script_enabled": null
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-05-09T13:18:33.486Z",
    "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",
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "whole_connector_response": "{\"transactionResponse\":{\"responseCode\":\"1\",\"authCode\":\"140GJ4\",\"avsResultCode\":\"Y\",\"cvvResultCode\":\"P\",\"cavvResultCode\":\"2\",\"transId\":\"80040892370\",\"refTransID\":\"\",\"transHash\":\"\",\"testRequest\":\"0\",\"accountNumber\":\"XXXX0000\",\"accountType\":\"Visa\",\"messages\":[{\"code\":\"1\",\"description\":\"This transaction has been approved.\"}],\"transHashSha2\":\"EDD14C10BDDBD427B768E42099F1AF0D089221FA13F9CA55D8B6323C8449585476AFEE55B4A054EE7FD26F73D4B85EF147B0552F0DB4EE17F4F60F8FB16CA2B9\",\"SupplementalDataQualificationIndicator\":0,\"networkTransId\":\"Z9TSL0XISGMU542D7Z5TF0A\"},\"refId\":\"\",\"messages\":{\"resultCode\":\"Ok\",\"message\":[{\"code\":\"I00001\",\"text\":\"Successful.\"}]}}"
}
```

Psync:

URL:

```
{{baseUrl}}/payments/:id?expand_captures=true&expand_attempts=true&all_keys_required=true
```

Response:

```
{
    "payment_id": "pay_UHNVQh54xvuv97CixQVF",
    "merchant_id": "merchant_1746796056",
    "status": "succeeded",
    "amount": 35308,
    "net_amount": 35308,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 35308,
    "connector": "authorizedotnet",
    "client_secret": "pay_UHNVQh54xvuv97CixQVF_secret_aUvQnXDaU6Op4uFuWHC1",
    "created": "2025-05-09T13:08:19.469Z",
    "currency": "USD",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_UHNVQh54xvuv97CixQVF_1",
            "status": "charged",
            "amount": 35308,
            "order_tax_amount": null,
            "currency": "USD",
            "connector": "authorizedotnet",
            "error_message": null,
            "payment_method": "card",
            "connector_transaction_id": "80040892370",
            "capture_method": "automatic",
            "authentication_type": "three_ds",
            "created_at": "2025-05-09T13:08:19.470Z",
            "modified_at": "2025-05-09T13:18:33.485Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": "token_xZJ3bAv0dVvWBWpuYRga",
            "connector_metadata": {
                "creditCard": {
                    "cardNumber": "XXXX0000",
                    "expirationDate": "XXXX"
                }
            },
            "payment_experience": null,
            "payment_method_type": "credit",
            "reference_id": "80040892370",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0000",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "491761",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_xZJ3bAv0dVvWBWpuYRga",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": null,
    "authentication_type": "three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "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": "80040892370",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "80040892370",
    "payment_link": null,
    "profile_id": "pro_NLQkgFo4oL87ujOInwp1",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_Bjt7NDYXrZmazh9Tdavu",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-09T13:23:19.469Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": null,
        "language": null,
        "time_zone": null,
        "ip_address": "::1",
        "os_version": null,
        "user_agent": null,
        "color_depth": null,
        "device_model": null,
        "java_enabled": null,
        "screen_width": null,
        "accept_header": null,
        "screen_height": null,
        "accept_language": "en",
        "java_script_enabled": null
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-05-09T13:19:32.525Z",
    "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",
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "whole_connector_response": "{\"transaction\":{\"transId\":\"80040892370\",\"submitTimeUTC\":\"2025-05-09T13:18:33.043Z\",\"submitTimeLocal\":\"2025-05-09T06:18:33.043\",\"transactionType\":\"authCaptureTransaction\",\"transactionStatus\":\"capturedPendingSettlement\",\"responseCode\":1,\"responseReasonCode\":1,\"responseReasonDescription\":\"Approval\",\"authCode\":\"140GJ4\",\"AVSResponse\":\"Y\",\"cardCodeResponse\":\"P\",\"order\":{\"description\":\"pay_UHNVQh54xvuv97CixQVF_1\",\"discountAmount\":0.0,\"taxIsAfterDiscount\":false},\"authAmount\":353.08,\"settleAmount\":353.08,\"taxExempt\":false,\"payment\":{\"creditCard\":{\"cardNumber\":\"XXXX0000\",\"expirationDate\":\"XXXX\",\"cardType\":\"Visa\"}},\"billTo\":{\"firstName\":\"joseph\",\"lastName\":\"Doe\",\"address\":\"1467\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"},\"recurringBilling\":false,\"customerIP\":\"110.227.219.118\",\"product\":\"Card Not Present\",\"marketType\":\"eCommerce\",\"networkTransId\":\"Z9TSL0XISGMU542D7Z5TF0A\",\"authorizationIndicator\":\"final\"},\"messages\":{\"resultCode\":\"Ok\",\"message\":[{\"code\":\"I00001\",\"text\":\"Successful.\"}]}}"
}
```

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