refactor(payment_methods_v2): rename payment_method and payment_method_type fields and use concrete type for payment_method_data (#6555)

This commit is contained in:
Sanchith Hegde
2024-11-19 20:33:30 +05:30
committed by GitHub
parent e730a2ee5a
commit 11e92413b2
31 changed files with 1172 additions and 499 deletions

View File

@ -196,6 +196,10 @@ impl ApiEventMetric for PaymentsResponse {
}
impl ApiEventMetric for PaymentMethodResponse {
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::PaymentMethod {
payment_method_id: self.payment_method_id.clone(),
@ -203,6 +207,15 @@ impl ApiEventMetric for PaymentMethodResponse {
payment_method_type: self.payment_method_type,
})
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::PaymentMethod {
payment_method_id: self.payment_method_id.clone(),
payment_method: self.payment_method_type,
payment_method_type: self.payment_method_subtype,
})
}
}
impl ApiEventMetric for PaymentMethodUpdate {}