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(network_tokenization): add User-Agent header to network token service (#15027)

Ritam Kabiraj0a2be15f008d
diff --git a/crates/router/src/core/payment_methods/network_tokenization.rs b/crates/router/src/core/payment_methods/network_tokenization.rs
index 53b3cf6df5..c348faa3d5 100644
--- a/crates/router/src/core/payment_methods/network_tokenization.rs
+++ b/crates/router/src/core/payment_methods/network_tokenization.rs
@@ -21,6 +21,7 @@ use error_stack::{report, ResultExt};
use hyperswitch_domain_models::payment_method_data::{
NetworkTokenDetails, NetworkTokenDetailsPaymentMethod,
};
+use hyperswitch_interfaces::consts::USER_AGENT;
use hyperswitch_masking::{ErasedMaskSerialize, ExposeInterface, Mask, PeekInterface, Secret};
use josekit::jwe;
@@ -99,6 +100,7 @@ async fn call_network_token_service(
.clone()
.into_masked(),
);
+ request.add_header(headers::USER_AGENT, USER_AGENT.to_string().into());
request.add_default_headers();
if let Some(body_content) = body {