diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index 7718c2fc72..958867465f 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -7,6 +7,7 @@ use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use router_env::{instrument, tracing}; +use stripe::auth_headers; use self::transformers as stripe; use super::utils::{self as connector_utils, RefundsRequestData}; @@ -55,10 +56,16 @@ impl ConnectorCommon for Stripe { let auth: stripe::StripeAuthType = auth_type .try_into() .change_context(errors::ConnectorError::FailedToObtainAuthType)?; - Ok(vec![( - headers::AUTHORIZATION.to_string(), - format!("Bearer {}", auth.api_key.peek()).into_masked(), - )]) + Ok(vec![ + ( + headers::AUTHORIZATION.to_string(), + format!("Bearer {}", auth.api_key.peek()).into_masked(), + ), + ( + auth_headers::STRIPE_API_VERSION.to_string(), + auth_headers::STRIPE_VERSION.to_string().into_masked(), + ), + ]) } } diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index 45e2c795a0..719710b602 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -32,6 +32,11 @@ use crate::{ utils::OptionExt, }; +pub mod auth_headers { + pub const STRIPE_API_VERSION: &str = "stripe-version"; + pub const STRIPE_VERSION: &str = "2023-10-16"; +} + pub struct StripeAuthType { pub(super) api_key: Secret, }