feat(router): add api_models and openapi changes for refunds create api v2 (#6385)

This commit is contained in:
Sai Harsha Vardhan
2024-10-23 16:53:46 +05:30
committed by GitHub
parent 4ef48c39b3
commit 5a10e5867a
15 changed files with 469 additions and 38 deletions

View File

@ -6,6 +6,7 @@ use crate::refunds::{
RefundUpdateRequest, RefundsRetrieveRequest,
};
#[cfg(feature = "v1")]
impl ApiEventMetric for RefundRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
let payment_id = self.payment_id.clone();
@ -18,6 +19,7 @@ impl ApiEventMetric for RefundRequest {
}
}
#[cfg(feature = "v1")]
impl ApiEventMetric for RefundResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Refund {
@ -27,6 +29,17 @@ impl ApiEventMetric for RefundResponse {
}
}
#[cfg(feature = "v2")]
impl ApiEventMetric for RefundResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Refund {
payment_id: self.payment_id.clone(),
refund_id: self.id.clone(),
})
}
}
#[cfg(feature = "v1")]
impl ApiEventMetric for RefundsRetrieveRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Refund {
@ -36,6 +49,7 @@ impl ApiEventMetric for RefundsRetrieveRequest {
}
}
#[cfg(feature = "v1")]
impl ApiEventMetric for RefundUpdateRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Refund {
@ -45,6 +59,7 @@ impl ApiEventMetric for RefundUpdateRequest {
}
}
#[cfg(feature = "v1")]
impl ApiEventMetric for RefundManualUpdateRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Refund {