feat(core): enable payments void for multiple partial capture (#2048)

This commit is contained in:
Hrithikesh
2023-09-11 23:09:36 +05:30
committed by GitHub
parent ffe9009d65
commit a81bfe28ed
15 changed files with 230 additions and 652 deletions

View File

@ -59,6 +59,36 @@ pub enum AttemptStatus {
DeviceDataCollectionPending,
}
impl AttemptStatus {
pub fn is_terminal_status(self) -> bool {
match self {
Self::RouterDeclined
| Self::Charged
| Self::AutoRefunded
| Self::Voided
| Self::VoidFailed
| Self::CaptureFailed
| Self::Failure => true,
Self::Started
| Self::AuthenticationFailed
| Self::AuthenticationPending
| Self::AuthenticationSuccessful
| Self::Authorized
| Self::AuthorizationFailed
| Self::Authorizing
| Self::CodInitiated
| Self::VoidInitiated
| Self::CaptureInitiated
| Self::PartialCharged
| Self::Unresolved
| Self::Pending
| Self::PaymentMethodAwaited
| Self::ConfirmationAwaited
| Self::DeviceDataCollectionPending => false,
}
}
}
#[derive(
Clone,
Copy,