Skip to content

Commit

Permalink
refactor(api_models): remove unused mapping of attempt status to inte…
Browse files Browse the repository at this point in the history
…nt status (#1127)
  • Loading branch information
Abhicodes-crypto committed May 11, 2023
1 parent 0177f1d commit 45ccc41
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,39 +850,6 @@ pub enum CardNetwork {
Maestro,
}

impl From<AttemptStatus> for IntentStatus {
fn from(s: AttemptStatus) -> Self {
match s {
AttemptStatus::Charged | AttemptStatus::AutoRefunded => Self::Succeeded,

AttemptStatus::ConfirmationAwaited => Self::RequiresConfirmation,
AttemptStatus::PaymentMethodAwaited => Self::RequiresPaymentMethod,

AttemptStatus::Authorized => Self::RequiresCapture,
AttemptStatus::AuthenticationPending | AttemptStatus::DeviceDataCollectionPending => {
Self::RequiresCustomerAction
}
AttemptStatus::Unresolved => Self::RequiresMerchantAction,
AttemptStatus::PartialCharged
| AttemptStatus::Started
| AttemptStatus::AuthenticationSuccessful
| AttemptStatus::Authorizing
| AttemptStatus::CodInitiated
| AttemptStatus::VoidInitiated
| AttemptStatus::CaptureInitiated
| AttemptStatus::Pending => Self::Processing,

AttemptStatus::AuthenticationFailed
| AttemptStatus::AuthorizationFailed
| AttemptStatus::VoidFailed
| AttemptStatus::RouterDeclined
| AttemptStatus::CaptureFailed
| AttemptStatus::Failure => Self::Failed,
AttemptStatus::Voided => Self::Cancelled,
}
}
}

#[derive(
Clone,
Default,
Expand Down

0 comments on commit 45ccc41

Please sign in to comment.