mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(router): add an endpoint for extending authorization (#9813)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -31,11 +31,12 @@ use crate::{
|
||||
PaymentListResponseV2, PaymentsApproveRequest, PaymentsCancelPostCaptureRequest,
|
||||
PaymentsCancelRequest, PaymentsCaptureRequest, PaymentsCompleteAuthorizeRequest,
|
||||
PaymentsDynamicTaxCalculationRequest, PaymentsDynamicTaxCalculationResponse,
|
||||
PaymentsExternalAuthenticationRequest, PaymentsExternalAuthenticationResponse,
|
||||
PaymentsIncrementalAuthorizationRequest, PaymentsManualUpdateRequest,
|
||||
PaymentsManualUpdateResponse, PaymentsPostSessionTokensRequest,
|
||||
PaymentsPostSessionTokensResponse, PaymentsRejectRequest, PaymentsRetrieveRequest,
|
||||
PaymentsStartRequest, PaymentsUpdateMetadataRequest, PaymentsUpdateMetadataResponse,
|
||||
PaymentsExtendAuthorizationRequest, PaymentsExternalAuthenticationRequest,
|
||||
PaymentsExternalAuthenticationResponse, PaymentsIncrementalAuthorizationRequest,
|
||||
PaymentsManualUpdateRequest, PaymentsManualUpdateResponse,
|
||||
PaymentsPostSessionTokensRequest, PaymentsPostSessionTokensResponse, PaymentsRejectRequest,
|
||||
PaymentsRetrieveRequest, PaymentsStartRequest, PaymentsUpdateMetadataRequest,
|
||||
PaymentsUpdateMetadataResponse,
|
||||
},
|
||||
};
|
||||
|
||||
@ -143,6 +144,14 @@ impl ApiEventMetric for PaymentsCancelPostCaptureRequest {
|
||||
})
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "v1")]
|
||||
impl ApiEventMetric for PaymentsExtendAuthorizationRequest {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
payment_id: self.payment_id.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1")]
|
||||
impl ApiEventMetric for PaymentsApproveRequest {
|
||||
|
||||
@ -8469,6 +8469,13 @@ pub struct PaymentsCancelPostCaptureRequest {
|
||||
pub cancellation_reason: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
|
||||
/// Request constructed internally for extending authorization
|
||||
pub struct PaymentsExtendAuthorizationRequest {
|
||||
/// The identifier for the payment
|
||||
pub payment_id: id_type::PaymentId,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
|
||||
pub struct PaymentsIncrementalAuthorizationRequest {
|
||||
/// The identifier for the payment
|
||||
|
||||
@ -20,6 +20,8 @@ pub enum IncomingWebhookEvent {
|
||||
PaymentIntentCancelFailure,
|
||||
PaymentIntentAuthorizationSuccess,
|
||||
PaymentIntentAuthorizationFailure,
|
||||
PaymentIntentExtendAuthorizationSuccess,
|
||||
PaymentIntentExtendAuthorizationFailure,
|
||||
PaymentIntentCaptureSuccess,
|
||||
PaymentIntentCaptureFailure,
|
||||
PaymentIntentExpired,
|
||||
@ -265,7 +267,9 @@ impl From<IncomingWebhookEvent> for WebhookFlow {
|
||||
| IncomingWebhookEvent::PaymentIntentAuthorizationFailure
|
||||
| IncomingWebhookEvent::PaymentIntentCaptureSuccess
|
||||
| IncomingWebhookEvent::PaymentIntentCaptureFailure
|
||||
| IncomingWebhookEvent::PaymentIntentExpired => Self::Payment,
|
||||
| IncomingWebhookEvent::PaymentIntentExpired
|
||||
| IncomingWebhookEvent::PaymentIntentExtendAuthorizationSuccess
|
||||
| IncomingWebhookEvent::PaymentIntentExtendAuthorizationFailure => Self::Payment,
|
||||
IncomingWebhookEvent::EventNotSupported => Self::ReturnResponse,
|
||||
IncomingWebhookEvent::RefundSuccess | IncomingWebhookEvent::RefundFailure => {
|
||||
Self::Refund
|
||||
|
||||
Reference in New Issue
Block a user