Skip to content

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

refactor(payouts): Propagate `Not Implemented` error (#3429)

Sakil Mostak5ab44377b849
diff --git a/crates/router/src/connector/wise.rs b/crates/router/src/connector/wise.rs
index d2ec08c607..66ccf22c10 100644
--- a/crates/router/src/connector/wise.rs
+++ b/crates/router/src/connector/wise.rs
@@ -589,6 +589,17 @@ impl
types::PayoutsResponseData,
> for Wise
{
+ fn build_request(
+ &self,
+ _req: &types::PayoutsRouterData<api::PoEligibility>,
+ _connectors: &settings::Connectors,
+ ) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
+ // Eligiblity check for cards is not implemented
+ Err(
+ errors::ConnectorError::NotImplemented("Payout Eligibility for Wise".to_string())
+ .into(),
+ )
+ }
}
#[cfg(feature = "payouts")]
diff --git a/crates/router/src/core/errors/utils.rs b/crates/router/src/core/errors/utils.rs
index f00948b887..a54dae1c03 100644
--- a/crates/router/src/core/errors/utils.rs
+++ b/crates/router/src/core/errors/utils.rs
@@ -461,6 +461,13 @@ impl<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError>
message: format!("{} by {}", message, connector),
}
}
+ errors::ConnectorError::NotImplemented(reason) => {
+ errors::ApiErrorResponse::NotImplemented {
+ message: errors::api_error_response::NotImplementedMessage::Reason(
+ reason.to_string(),
+ ),
+ }
+ }
_ => errors::ApiErrorResponse::InternalServerError,
};
err.change_context(error)