feat(payments_v2): add payment_confirm_intent api endpoint (#6263)

Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: sai-harsha-vardhan <harsha111hero@gmail.com>
Co-authored-by: Shankar Singh C <83439957+ShankarSinghC@users.noreply.github.com>
Co-authored-by: spritianeja03 <146620839+spritianeja03@users.noreply.github.com>
Co-authored-by: Spriti Aneja <spriti.aneja@juspay.in>
This commit is contained in:
Narayan Bhat
2024-10-24 16:10:01 +05:30
committed by GitHub
parent 26e0c32f4d
commit c7c1e1adab
125 changed files with 3930 additions and 3481 deletions

View File

@ -1,9 +1,9 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
#[cfg(feature = "v2")]
use super::PaymentsCreateIntentRequest;
#[cfg(feature = "v2")]
use super::PaymentsCreateIntentResponse;
use super::{
PaymentsConfirmIntentResponse, PaymentsCreateIntentRequest, PaymentsCreateIntentResponse,
};
#[cfg(all(
any(feature = "v2", feature = "v1"),
not(feature = "payment_methods_v2")
@ -20,7 +20,7 @@ use crate::{
PaymentMethodResponse, PaymentMethodUpdate,
},
payments::{
ExtendedCardInfoResponse, PaymentIdType, PaymentListConstraints,
self, ExtendedCardInfoResponse, PaymentIdType, PaymentListConstraints,
PaymentListFilterConstraints, PaymentListFilters, PaymentListFiltersV2,
PaymentListResponse, PaymentListResponseV2, PaymentsAggregateResponse,
PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest,
@ -29,8 +29,8 @@ use crate::{
PaymentsExternalAuthenticationResponse, PaymentsIncrementalAuthorizationRequest,
PaymentsManualUpdateRequest, PaymentsManualUpdateResponse,
PaymentsPostSessionTokensRequest, PaymentsPostSessionTokensResponse, PaymentsRejectRequest,
PaymentsRequest, PaymentsResponse, PaymentsRetrieveRequest, PaymentsSessionResponse,
PaymentsStartRequest, RedirectionResponse,
PaymentsResponse, PaymentsRetrieveRequest, PaymentsSessionResponse, PaymentsStartRequest,
RedirectionResponse,
},
};
@ -131,7 +131,7 @@ impl ApiEventMetric for PaymentsRejectRequest {
}
#[cfg(feature = "v1")]
impl ApiEventMetric for PaymentsRequest {
impl ApiEventMetric for payments::PaymentsRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
match self.payment_id {
Some(PaymentIdType::PaymentIntentId(ref id)) => Some(ApiEventsType::Payment {
@ -158,6 +158,15 @@ impl ApiEventMetric for PaymentsCreateIntentResponse {
}
}
#[cfg(feature = "v2")]
impl ApiEventMetric for PaymentsConfirmIntentResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Payment {
payment_id: self.id.clone(),
})
}
}
#[cfg(feature = "v1")]
impl ApiEventMetric for PaymentsResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {