mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
refactor(api_models): remove unused mapping of attempt status to intent status (#1127)
This commit is contained in:
committed by
GitHub
parent
0177f1d1b9
commit
45ccc410ea
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user