mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(router): Add payments get-intent API for v2 (#6396)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -2,7 +2,8 @@ use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
use super::{
|
||||
PaymentsConfirmIntentResponse, PaymentsCreateIntentRequest, PaymentsCreateIntentResponse,
|
||||
PaymentsConfirmIntentResponse, PaymentsCreateIntentRequest, PaymentsGetIntentRequest,
|
||||
PaymentsIntentResponse,
|
||||
};
|
||||
#[cfg(all(
|
||||
any(feature = "v2", feature = "v1"),
|
||||
@ -150,7 +151,16 @@ impl ApiEventMetric for PaymentsCreateIntentRequest {
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
impl ApiEventMetric for PaymentsCreateIntentResponse {
|
||||
impl ApiEventMetric for PaymentsGetIntentRequest {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
payment_id: self.id.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
impl ApiEventMetric for PaymentsIntentResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
payment_id: self.id.clone(),
|
||||
|
||||
@ -287,10 +287,17 @@ impl PaymentsCreateIntentRequest {
|
||||
}
|
||||
}
|
||||
|
||||
// This struct is only used internally, not visible in API Reference
|
||||
#[derive(Debug, Clone, serde::Serialize)]
|
||||
#[cfg(feature = "v2")]
|
||||
pub struct PaymentsGetIntentRequest {
|
||||
pub id: id_type::GlobalPaymentId,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, Clone, ToSchema)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
#[cfg(feature = "v2")]
|
||||
pub struct PaymentsCreateIntentResponse {
|
||||
pub struct PaymentsIntentResponse {
|
||||
/// Global Payment Id for the payment
|
||||
#[schema(value_type = String)]
|
||||
pub id: id_type::GlobalPaymentId,
|
||||
|
||||
Reference in New Issue
Block a user