refactor(router): Remove payment_methods_v2 and customer_v2 feature flag (#8236)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prasunna Soppa
2025-06-12 00:07:24 +05:30
committed by GitHub
parent 6ea2e2a6f4
commit 000aa23c10
106 changed files with 896 additions and 1856 deletions

View File

@ -4,7 +4,7 @@ use crate::customers::{
CustomerDeleteResponse, CustomerRequest, CustomerResponse, CustomerUpdateRequestInternal,
};
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
impl ApiEventMetric for CustomerDeleteResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Customer {
@ -13,7 +13,7 @@ impl ApiEventMetric for CustomerDeleteResponse {
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
impl ApiEventMetric for CustomerDeleteResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Customer {
@ -22,7 +22,7 @@ impl ApiEventMetric for CustomerDeleteResponse {
}
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
impl ApiEventMetric for CustomerRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
self.get_merchant_reference_id()
@ -31,14 +31,14 @@ impl ApiEventMetric for CustomerRequest {
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
impl ApiEventMetric for CustomerRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Customer { customer_id: None })
}
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
impl ApiEventMetric for CustomerResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
self.get_merchant_reference_id()
@ -47,7 +47,7 @@ impl ApiEventMetric for CustomerResponse {
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
impl ApiEventMetric for CustomerResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Customer {
@ -56,7 +56,7 @@ impl ApiEventMetric for CustomerResponse {
}
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[cfg(feature = "v1")]
impl ApiEventMetric for CustomerUpdateRequestInternal {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Customer {
@ -65,7 +65,7 @@ impl ApiEventMetric for CustomerUpdateRequestInternal {
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[cfg(feature = "v2")]
impl ApiEventMetric for CustomerUpdateRequestInternal {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Customer {

View File

@ -213,10 +213,7 @@ impl ApiEventMetric for payments::PaymentsResponse {
}
impl ApiEventMetric for PaymentMethodResponse {
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
#[cfg(feature = "v1")]
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::PaymentMethod {
payment_method_id: self.payment_method_id.clone(),
@ -225,7 +222,7 @@ impl ApiEventMetric for PaymentMethodResponse {
})
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
#[cfg(feature = "v2")]
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::PaymentMethod {
payment_method_id: self.id.clone(),
@ -236,10 +233,7 @@ impl ApiEventMetric for PaymentMethodResponse {
}
impl ApiEventMetric for PaymentMethodMigrateResponse {
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
#[cfg(feature = "v1")]
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::PaymentMethod {
payment_method_id: self.payment_method_response.payment_method_id.clone(),
@ -248,7 +242,7 @@ impl ApiEventMetric for PaymentMethodMigrateResponse {
})
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
#[cfg(feature = "v2")]
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::PaymentMethod {
payment_method_id: self.payment_method_response.id.clone(),