From 6f3005d5fd973a9a214301c0ff1a8219d2c40ea4 Mon Sep 17 00:00:00 2001 From: swangi-kumari Date: Tue, 5 Mar 2024 13:57:50 +0530 Subject: [PATCH] refactor: undo status mapping --- .../router/src/connector/authorizedotnet.rs | 4 +-- .../connector/authorizedotnet/transformers.rs | 34 ++++--------------- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/crates/router/src/connector/authorizedotnet.rs b/crates/router/src/connector/authorizedotnet.rs index 62f576f48a55..0aba48fa5e57 100644 --- a/crates/router/src/connector/authorizedotnet.rs +++ b/crates/router/src/connector/authorizedotnet.rs @@ -685,8 +685,8 @@ impl ConnectorIntegration, - messages: ResponseMessages, -} - -#[derive(Debug, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct RSyncTransactionResponse { - #[serde(rename = "transId")] - transaction_id: String, - transaction_status: RSyncStatus, -} - -impl From for enums::RefundStatus { - fn from(transaction_status: RSyncStatus) -> Self { +impl From for enums::RefundStatus { + fn from(transaction_status: SyncStatus) -> Self { match transaction_status { - RSyncStatus::RefundSettledSuccessfully => Self::Success, - RSyncStatus::RefundPendingSettlement => Self::Pending, + SyncStatus::RefundSettledSuccessfully => Self::Success, + SyncStatus::RefundPendingSettlement => Self::Pending, + _ => Self::Failure, } } } @@ -994,13 +974,13 @@ impl From for enums::AttemptStatus { } } -impl TryFrom> +impl TryFrom> for types::RefundsRouterData { type Error = error_stack::Report; fn try_from( - item: types::RefundsResponseRouterData, + item: types::RefundsResponseRouterData, ) -> Result { match item.response.transaction { Some(transaction) => {