diff --git a/crates/router/src/core/errors/utils.rs b/crates/router/src/core/errors/utils.rs index 1f82132a45..d9b4e19013 100644 --- a/crates/router/src/core/errors/utils.rs +++ b/crates/router/src/core/errors/utils.rs @@ -160,6 +160,12 @@ impl ConnectorErrorExt for error_stack::Result } .into() } + errors::ConnectorError::NotSupported { message, connector } => { + errors::ApiErrorResponse::NotSupported { + message: format!("{message} is not supported by {connector}"), + } + .into() + } errors::ConnectorError::FailedToObtainIntegrationUrl | errors::ConnectorError::RequestEncodingFailed | errors::ConnectorError::RequestEncodingFailedWithReason(_) @@ -178,7 +184,6 @@ impl ConnectorErrorExt for error_stack::Result | errors::ConnectorError::FailedToObtainCertificate | errors::ConnectorError::NoConnectorMetaData | errors::ConnectorError::FailedToObtainCertificateKey - | errors::ConnectorError::NotSupported { .. } | errors::ConnectorError::FlowNotSupported { .. } | errors::ConnectorError::CaptureMethodNotSupported | errors::ConnectorError::MissingConnectorMandateID diff --git a/crates/router/src/core/refunds.rs b/crates/router/src/core/refunds.rs index 62d34b1306..06af7773f6 100644 --- a/crates/router/src/core/refunds.rs +++ b/crates/router/src/core/refunds.rs @@ -219,6 +219,16 @@ pub async fn trigger_refund_to_gateway( updated_by: storage_scheme.to_string(), }) } + errors::ConnectorError::NotSupported { message, connector } => { + Some(storage::RefundUpdate::ErrorUpdate { + refund_status: Some(enums::RefundStatus::Failure), + refund_error_message: Some(format!( + "{message} is not supported by {connector}" + )), + refund_error_code: Some("NOT_SUPPORTED".to_string()), + updated_by: storage_scheme.to_string(), + }) + } _ => None, }); // Update the refund status as failure if connector_error is NotImplemented