mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
refactor(core): updated payments response with payment_method_id & payment_method_status (#3883)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1205,6 +1205,36 @@ pub enum PaymentMethodStatus {
|
||||
Processing,
|
||||
}
|
||||
|
||||
impl From<AttemptStatus> for PaymentMethodStatus {
|
||||
fn from(attempt_status: AttemptStatus) -> Self {
|
||||
match attempt_status {
|
||||
AttemptStatus::Charged | AttemptStatus::Authorized => Self::Active,
|
||||
AttemptStatus::Failure => Self::Inactive,
|
||||
AttemptStatus::Voided
|
||||
| AttemptStatus::Started
|
||||
| AttemptStatus::Pending
|
||||
| AttemptStatus::Unresolved
|
||||
| AttemptStatus::CodInitiated
|
||||
| AttemptStatus::Authorizing
|
||||
| AttemptStatus::VoidInitiated
|
||||
| AttemptStatus::AuthorizationFailed
|
||||
| AttemptStatus::RouterDeclined
|
||||
| AttemptStatus::AuthenticationSuccessful
|
||||
| AttemptStatus::PaymentMethodAwaited
|
||||
| AttemptStatus::AuthenticationFailed
|
||||
| AttemptStatus::AuthenticationPending
|
||||
| AttemptStatus::CaptureInitiated
|
||||
| AttemptStatus::CaptureFailed
|
||||
| AttemptStatus::VoidFailed
|
||||
| AttemptStatus::AutoRefunded
|
||||
| AttemptStatus::PartialCharged
|
||||
| AttemptStatus::PartialChargedAndChargeable
|
||||
| AttemptStatus::ConfirmationAwaited
|
||||
| AttemptStatus::DeviceDataCollectionPending => Self::Processing,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// To indicate the type of payment experience that the customer would go through
|
||||
#[derive(
|
||||
Eq,
|
||||
|
||||
Reference in New Issue
Block a user