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

fix(analytics): added hs latency to api event for paymentconfirm call (#2787)

harsh-sharma-juspayaab8f6035c16
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index 2fcd792eca..c625298263 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<R, Op, F: Clone>(
connector_request_reference_id_config: &ConnectorRequestReferenceIdConfig,
connector_http_status_code: Option<u16>,
external_latency: Option<u128>,
- is_latency_header_enabled: Option<bool>,
+ _is_latency_header_enabled: Option<bool>,
) -> RouterResponse<api::PaymentsResponse>
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)