mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 05:17:02 +08:00
refactor(router): separate enums for api (#96)
This commit is contained in:
@ -1,16 +1 @@
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use crate::{core::errors, types::storage::enums};
|
||||
|
||||
impl TryFrom<enums::IntentStatus> for enums::EventType {
|
||||
type Error = errors::ValidationError;
|
||||
|
||||
fn try_from(value: enums::IntentStatus) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
enums::IntentStatus::Succeeded => Ok(Self::PaymentSucceeded),
|
||||
_ => Err(errors::ValidationError::IncorrectValueProvided {
|
||||
field_name: "intent_status",
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user