Skip to content

Commit

Permalink
fix(analytics): added hs latency to api event for paymentconfirm call (
Browse files Browse the repository at this point in the history
…#2787)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ivor-juspay <[email protected]>
  • Loading branch information
3 people authored Nov 9, 2023
1 parent e93f76b commit aab8f60
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/router/src/core/payments/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit aab8f60

Please sign in to comment.