From aab8f6035c16ca19009f8f1e0db688c17bc0b2b6 Mon Sep 17 00:00:00 2001 From: harsh-sharma-juspay <125131007+harsh-sharma-juspay@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:57:13 +0530 Subject: [PATCH] fix(analytics): added hs latency to api event for paymentconfirm call (#2787) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ivor-juspay <138492857+ivor-juspay@users.noreply.github.com> --- crates/router/src/core/payments/transformers.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index 2fcd792eca83..c62529826387 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -346,7 +346,7 @@ pub fn payments_to_payments_response( connector_request_reference_id_config: &ConnectorRequestReferenceIdConfig, connector_http_status_code: Option, external_latency: Option, - is_latency_header_enabled: Option, + _is_latency_header_enabled: Option, ) -> RouterResponse where Op: Debug, @@ -451,13 +451,13 @@ where payment_confirm_source.to_string(), )) } - if Some(true) == is_latency_header_enabled { - headers.extend( - external_latency - .map(|latency| vec![(X_HS_LATENCY.to_string(), latency.to_string())]) - .unwrap_or_default(), - ); - } + + headers.extend( + external_latency + .map(|latency| vec![(X_HS_LATENCY.to_string(), latency.to_string())]) + .unwrap_or_default(), + ); + let output = Ok(match payment_request { Some(_request) => { if payments::is_start_pay(&operation)