refactor(api_models): remove unused mapping of attempt status to intent status (#1127)

This commit is contained in:
Abhishek Marrivagu
2023-05-11 17:31:50 +05:30
committed by GitHub
parent 0177f1d1b9
commit 45ccc410ea

View File

@ -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,