Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(core): [REFUNDS] Fix Not Supported Connector Error (#4045)
DEEPANSHU BANSAL7513423631dd
diff --git a/crates/router/src/core/errors/utils.rs b/crates/router/src/core/errors/utils.rsindex 1f82132a45..d9b4e19013 100644--- a/crates/router/src/core/errors/utils.rs+++ b/crates/router/src/core/errors/utils.rs@@ -160,6 +160,12 @@ impl<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError>}.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<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError>| errors::ConnectorError::FailedToObtainCertificate| errors::ConnectorError::NoConnectorMetaData| errors::ConnectorError::FailedToObtainCertificateKey- | errors::ConnectorError::NotSupported { .. }| errors::ConnectorError::FlowNotSupported { .. }| errors::ConnectorError::CaptureMethodNotSupported| errors::ConnectorError::MissingConnectorMandateIDdiff --git a/crates/router/src/core/refunds.rs b/crates/router/src/core/refunds.rsindex 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