mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	refactor(connector): [Stripe] add stripe-api-version in API-headers (#4109)
This commit is contained in:
		| @ -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(), | ||||
|             ), | ||||
|         ]) | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -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<String>, | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Swangi Kumari
					Swangi Kumari