Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

feat(core): add all_keys_required in confirm and psync payload (#7998)

Anurag071b0732d164
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index b475142a57..6d52decc7c 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/api-reference/openapi_spec.json b/api-reference/openapi_spec.json
index c71ee457f5..2315a94b5e 100644
--- a/api-reference/openapi_spec.json
+++ b/api-reference/openapi_spec.json
@@ -18853,6 +18853,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
}
}
},
@@ -19353,6 +19358,11 @@
}
],
"nullable": true
+ },
+ "all_keys_required": {
+ "type": "boolean",
+ "description": "If enabled, provides whole connector response",
+ "nullable": true
}
}
},
@@ -19765,6 +19775,11 @@
}
],
"nullable": true
+ },
+ "all_keys_required": {
+ "type": "boolean",
+ "description": "If enabled, provides whole connector response",
+ "nullable": true
}
}
},
@@ -20343,6 +20358,11 @@
"type": "string",
"description": "Error message received from the issuer in case of failed payments",
"nullable": true
+ },
+ "whole_connector_response": {
+ "type": "string",
+ "description": "Contains whole connector response",
+ "nullable": true
}
}
},
@@ -21045,6 +21065,11 @@
}
],
"nullable": true
+ },
+ "all_keys_required": {
+ "type": "boolean",
+ "description": "If enabled, provides whole connector response",
+ "nullable": true
}
},
"additionalProperties": false
@@ -21649,6 +21674,11 @@
"type": "string",
"description": "Error message received from the issuer in case of failed payments",
"nullable": true
+ },
+ "whole_connector_response": {
+ "type": "string",
+ "description": "Contains whole connector response",
+ "nullable": true
}
}
},
@@ -21704,6 +21734,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
}
}
},
@@ -22189,6 +22224,11 @@
}
],
"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 6e81cf8049..b313a3b303 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 90b97471be..04c5cb531f 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -6136,6 +6136,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 d3f9a2bf8c..793808b134 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 e01cd5ae9e..8e2ecc8554 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 dd0bbace4f..77e7761e67 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 d39cc0c679..00baf1ddfb 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 ab28addb01..e1cf04c20a 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 0e7315c5d4..f3554d6d70 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 a7c9af44e8..873401d771 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 7b5cc9af4e..4c585ccd22 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 e18f29ea83..ae8849851e 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 ae00399769..d71d810335 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 4cef8db6ce..421c255e11 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 b60d812f1f..02d87853ea 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 5defd0d4b5..138097333c 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 cbf66632df..ded83e9b7b 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 a4dd1d2b19..e32709320c 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 004666d730..642a28c567 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 0b4590b2be..c27ab57504 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 c6b7de6732..bfe7f7962d 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?;
@@ -530,6 +531,7 @@ where
false,
false,
None,
+ <Req as Authenticate>::get_all_keys_required(&req),
)
.await?;
@@ -653,6 +655,7 @@ where
false,
false,
routing_decision,
+ <Req as Authenticate>::get_all_keys_required(&req),
)
.await?;
@@ -783,6 +786,7 @@ where
session_surcharge_details,
&business_profile,
header_payload.clone(),
+ <Req as Authenticate>::get_all_keys_required(&req),
))
.await?
}
@@ -911,6 +915,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,
@@ -1024,6 +1029,7 @@ where
schedule_time,
header_payload.clone(),
&business_profile,
+ all_keys_required,
)
.await?;
@@ -1109,10 +1115,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,
@@ -1153,6 +1160,7 @@ where
call_connector_action.clone(),
header_payload.clone(),
&profile,
+ all_keys_required,
)
.await?;
@@ -1626,6 +1634,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,
@@ -1656,6 +1665,7 @@ where
call_connector_action,
auth_flow,
header_payload.clone(),
+ all_keys_required,
)
.await?;
@@ -1684,10 +1694,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,
@@ -1735,6 +1746,7 @@ where
get_tracker_response,
call_connector_action,
header_payload.clone(),
+ all_keys_required,
)
.await?;
@@ -1821,6 +1833,7 @@ pub async fn record_attempt_core(
force_sync: true,
expand_attempts: false,
param: None,
+ all_keys_required: None,
},
operations::GetTrackerResponse {
payment_data: PaymentStatusData {
@@ -1834,6 +1847,7 @@ pub async fn record_attempt_core(
},
CallConnectorAction::Trigger,
HeaderPayload::default(),
+ None,
))
.await
{
@@ -2001,7 +2015,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,
@@ -2557,6 +2571,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, _, _, _, _>(
@@ -2689,6 +2704,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;
@@ -2933,6 +2949,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, _, _, _, _>(
@@ -3071,6 +3088,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,
@@ -3352,6 +3370,7 @@ where
connector_request,
business_profile,
header_payload.clone(),
+ all_keys_required,
)
.await
} else {
@@ -3383,6 +3402,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,
@@ -3499,6 +3519,7 @@ where
connector_request,
business_profile,
header_payload.clone(),
+ all_keys_required,
)
.await
} else {
@@ -3530,6 +3551,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,
@@ -3670,6 +3692,7 @@ where
connector_request,
business_profile,
header_payload.clone(),
+ all_keys_required,
)
.await
} else {
@@ -3696,6 +3719,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,
@@ -3791,6 +3815,7 @@ where
connector_request,
business_profile,
header_payload.clone(),
+ all_keys_required,
)
.await
} else {
@@ -4052,6 +4077,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,
@@ -4108,6 +4134,7 @@ where
None,
business_profile,
header_payload.clone(),
+ all_keys_required,
);
join_handlers.push(res);
@@ -4167,6 +4194,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,
@@ -4228,6 +4256,7 @@ where
None,
business_profile,
header_payload.clone(),
+ all_keys_required,
);
join_handlers.push(res);
@@ -5517,6 +5546,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>,
@@ -5547,6 +5577,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)]
@@ -5689,14 +5720,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,
@@ -8220,11 +8252,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>;
@@ -8415,6 +8449,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
@@ -8714,6 +8756,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")]
@@ -8949,6 +8999,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")]
@@ -9185,6 +9243,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")]
@@ -9422,6 +9488,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 53f7b3b4a4..f2f7596491 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 83f0134978..c0767aaf20 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 2e4864c80c..a27f3e0ce4 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 c63ad19742..7c9bb5b450 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 d6489dab3b..8c4a7a585b 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 3502e00e66..e6eebba312 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 eb4c7ed0f5..9b681e107a 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 a2a6de43af..768614b130 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 df4897ef92..74419a5cfb 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 a374eae98e..483d04e94d 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 58da60ed86..de435d47b1 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 9f49ebe143..f333518db2 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 79c08ef2a3..dcf424b4c8 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 af78904e4a..321f368199 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 7ec5dc22d8..fa2f94873a 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 f9a6790356..85d942f52c 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 a36c3c42fe..c3c6352152 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -4172,6 +4172,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 a3b182dc3c..a16c2cd433 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 fb0e7c70b2..343c1f98a9 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 7ac984ae8f..8e3a765b8a 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 1ec62d84a5..199b4faf62 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 a99359d7ea..8c5f72b340 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 fc781e1350..8ba549c59a 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 d8904d2c93..3df1da1827 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 27557afa53..33ec9a0d59 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 4c8edfb04e..2994bd5d5e 100644
--- a/crates/router/src/core/payments/operations/payment_response.rs
+++ b/crates/router/src/core/payments/operations/payment_response.rs
@@ -1415,6 +1415,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 e105ed69ba..b0a5f2fc13 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 429a1128b7..e702ba1ef5 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 58c784c652..c6cf1f96fe 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 0f3a58d9b9..4a21296298 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 d35b0b4044..2c6841c44a 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 662b32699d..e5262d092c 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 2a261da467..85ad5fb1cb 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 bfe2c99855..241a189d68 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 4c3d27b72e..d018ac1910 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 dd5e39da0d..c0338b5b60 100644
--- a/crates/router/src/core/payments/tokenization.rs
+++ b/crates/router/src/core/payments/tokenization.rs
@@ -1257,6 +1257,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()?;
@@ -1514,6 +1515,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 95aca37308..91dc162b91 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 87888ab425..ebc462d286 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 27fc2e8553..a675b5f4e3 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 0e3814107a..b9c9e497f6 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 ee10e1b308..922b9dce24 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 5aae99849c..e3f029ecb5 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 a473d0c20d..effc2178ec 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 ed0d2e250f..6046596485 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 8b30011e02..e551340e10 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 cbd4c2ee2e..bab5d41235 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 7b88998953..3d67c5e465 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 86769b393c..f50308d932 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 94fec01edf..b4ac1fbc80 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 89341614d9..79994a48e8 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 155a21b4d2..4cf0d784a0 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 6af6a7af6e..3ea5049742 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 4bc57cfdaa..54384e107a 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 af5d983a48..0c1255850a 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 223c3e5638..ad9a490398 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 3497a048a8..61272a0587 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 d6925ae166..543d245114 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 82296d2a83..1879af550f 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 1240d1c17a..e7aaa09f5b 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![],
));