mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(router): Add v2 endpoint to list payment attempts by intent_id (#8368)
Co-authored-by: Aniket Burman <aniket.burman@Aniket-Burman-JDXHW2PH34.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -2,8 +2,8 @@ use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
use super::{
|
||||
PaymentStartRedirectionRequest, PaymentsCreateIntentRequest, PaymentsGetIntentRequest,
|
||||
PaymentsIntentResponse, PaymentsRequest,
|
||||
PaymentAttemptListRequest, PaymentAttemptListResponse, PaymentStartRedirectionRequest,
|
||||
PaymentsCreateIntentRequest, PaymentsGetIntentRequest, PaymentsIntentResponse, PaymentsRequest,
|
||||
};
|
||||
#[cfg(feature = "v2")]
|
||||
use crate::payment_methods::PaymentMethodListResponseForSession;
|
||||
@ -185,6 +185,22 @@ impl ApiEventMetric for PaymentsGetIntentRequest {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
impl ApiEventMetric for PaymentAttemptListRequest {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
payment_id: self.payment_intent_id.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
impl ApiEventMetric for PaymentAttemptListResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
impl ApiEventMetric for PaymentsIntentResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
|
||||
@ -290,7 +290,18 @@ pub struct MerchantConnectorDetails {
|
||||
}"#)]
|
||||
pub merchant_connector_creds: pii::SecretSerdeValue,
|
||||
}
|
||||
#[cfg(feature = "v2")]
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
|
||||
pub struct PaymentAttemptListRequest {
|
||||
#[schema(value_type = String)]
|
||||
pub payment_intent_id: id_type::GlobalPaymentId,
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
#[derive(Debug, serde::Serialize, Clone, ToSchema)]
|
||||
pub struct PaymentAttemptListResponse {
|
||||
pub payment_attempt_list: Vec<PaymentAttemptResponse>,
|
||||
}
|
||||
#[cfg(feature = "v2")]
|
||||
impl PaymentsCreateIntentRequest {
|
||||
pub fn get_feature_metadata_as_value(
|
||||
|
||||
Reference in New Issue
Block a user