mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(core): Add support for Void after Capture (#8839)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -27,8 +27,8 @@ use crate::{
|
||||
payment_methods::{PaymentMethodListRequest, PaymentMethodListResponse},
|
||||
payments::{
|
||||
ExtendedCardInfoResponse, PaymentIdType, PaymentListFilterConstraints,
|
||||
PaymentListResponseV2, PaymentsApproveRequest, PaymentsCancelRequest,
|
||||
PaymentsCaptureRequest, PaymentsCompleteAuthorizeRequest,
|
||||
PaymentListResponseV2, PaymentsApproveRequest, PaymentsCancelPostCaptureRequest,
|
||||
PaymentsCancelRequest, PaymentsCaptureRequest, PaymentsCompleteAuthorizeRequest,
|
||||
PaymentsDynamicTaxCalculationRequest, PaymentsDynamicTaxCalculationResponse,
|
||||
PaymentsExternalAuthenticationRequest, PaymentsExternalAuthenticationResponse,
|
||||
PaymentsIncrementalAuthorizationRequest, PaymentsManualUpdateRequest,
|
||||
@ -134,6 +134,15 @@ impl ApiEventMetric for PaymentsCancelRequest {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1")]
|
||||
impl ApiEventMetric for PaymentsCancelPostCaptureRequest {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
payment_id: self.payment_id.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1")]
|
||||
impl ApiEventMetric for PaymentsApproveRequest {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
|
||||
@ -221,6 +221,7 @@ pub enum TxnStatus {
|
||||
Authorizing,
|
||||
CODInitiated,
|
||||
Voided,
|
||||
VoidedPostCharge,
|
||||
VoidInitiated,
|
||||
Nop,
|
||||
CaptureInitiated,
|
||||
|
||||
@ -7689,6 +7689,16 @@ pub struct PaymentsCancelRequest {
|
||||
pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,
|
||||
}
|
||||
|
||||
/// Request to cancel a payment when the payment is already captured
|
||||
#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
|
||||
pub struct PaymentsCancelPostCaptureRequest {
|
||||
/// The identifier for the payment
|
||||
#[serde(skip)]
|
||||
pub payment_id: id_type::PaymentId,
|
||||
/// The reason for the payment cancel
|
||||
pub cancellation_reason: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
|
||||
pub struct PaymentsIncrementalAuthorizationRequest {
|
||||
/// The identifier for the payment
|
||||
|
||||
Reference in New Issue
Block a user