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
chore: intoduce GenericError enum variant in enum ConnectorError (#6143)
Hrithikeshb694171bab2f
diff --git a/api-reference-v2/api-reference/business-profile/merchant-connector--list.mdx b/api-reference-v2/api-reference/business-profile/merchant-connector--list.mdxnew file mode 100644index 0000000000..6560f45e5f--- /dev/null+++ b/api-reference-v2/api-reference/business-profile/merchant-connector--list.mdx@@ -0,0 +1,3 @@+---+openapi: get /v2/profiles/{profile_id}/connector_accounts+---\ No newline at end of filediff --git a/api-reference-v2/api-reference/merchant-account/profile--list.mdx b/api-reference-v2/api-reference/merchant-account/profile--list.mdxnew file mode 100644index 0000000000..e14bc0d6ef--- /dev/null+++ b/api-reference-v2/api-reference/merchant-account/profile--list.mdx@@ -0,0 +1,3 @@+---+openapi: get /v2/merchant_accounts/{account_id}/profiles+---\ No newline at end of filediff --git a/api-reference-v2/api-reference/organization/merchant-account--list.mdx b/api-reference-v2/api-reference/organization/organization--merchant-account--list.mdxsimilarity index 100%rename from api-reference-v2/api-reference/organization/merchant-account--list.mdxrename to api-reference-v2/api-reference/organization/organization--merchant-account--list.mdxdiff --git a/api-reference-v2/mint.json b/api-reference-v2/mint.jsonindex 030d29958d..64047f5b56 100644--- a/api-reference-v2/mint.json+++ b/api-reference-v2/mint.json@@ -46,7 +46,7 @@"api-reference/organization/organization--create","api-reference/organization/organization--retrieve","api-reference/organization/organization--update",- "api-reference/organization/merchant-account--list"+ "api-reference/organization/organization--merchant-account--list"]},{diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.jsonindex 7ffed5fa05..17b44a9810 100644--- a/api-reference-v2/openapi_spec.json+++ b/api-reference-v2/openapi_spec.json@@ -169,7 +169,7 @@"tags": ["Organization"],- "summary": "Merchant Account - List",+ "summary": "Organization - Merchant Account - List","description": "List merchant accounts for an Organization","operationId": "List Merchant Accounts","parameters": [diff --git a/crates/hyperswitch_interfaces/src/errors.rs b/crates/hyperswitch_interfaces/src/errors.rsindex c600955734..466186ae36 100644--- a/crates/hyperswitch_interfaces/src/errors.rs+++ b/crates/hyperswitch_interfaces/src/errors.rs@@ -119,6 +119,11 @@ pub enum ConnectorError {InvalidConnectorConfig { config: &'static str },#[error("Failed to convert amount to required type")]AmountConversionFailed,+ #[error("Generic Error")]+ GenericError {+ error_message: String,+ error_object: serde_json::Value,+ },}impl ConnectorError {diff --git a/crates/openapi/src/routes/organization.rs b/crates/openapi/src/routes/organization.rsindex ad15c0e679..08ee56725e 100644--- a/crates/openapi/src/routes/organization.rs+++ b/crates/openapi/src/routes/organization.rs@@ -145,7 +145,7 @@ pub async fn organization_retrieve() {}pub async fn organization_update() {}#[cfg(feature = "v2")]-/// Merchant Account - List+/// Organization - Merchant Account - List////// List merchant accounts for an Organization#[utoipa::path(diff --git a/crates/router/src/core/errors/utils.rs b/crates/router/src/core/errors/utils.rsindex 70eaa04cac..391d808847 100644--- a/crates/router/src/core/errors/utils.rs+++ b/crates/router/src/core/errors/utils.rs@@ -218,7 +218,8 @@ impl<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError>| errors::ConnectorError::RequestTimeoutReceived| errors::ConnectorError::CurrencyNotSupported { .. }| errors::ConnectorError::InvalidConnectorConfig { .. }- | errors::ConnectorError::AmountConversionFailed { .. } => {+ | errors::ConnectorError::AmountConversionFailed { .. }+ | errors::ConnectorError::GenericError { .. } => {err.change_context(errors::ApiErrorResponse::RefundFailed { data: None })}})@@ -314,6 +315,7 @@ impl<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError>errors::ConnectorError::InSufficientBalanceInPaymentMethod |errors::ConnectorError::RequestTimeoutReceived |errors::ConnectorError::ProcessingStepFailed(None)|+ errors::ConnectorError::GenericError {..} |errors::ConnectorError::AmountConversionFailed => errors::ApiErrorResponse::InternalServerError};err.change_context(error)@@ -407,7 +409,8 @@ impl<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError>| errors::ConnectorError::RequestTimeoutReceived| errors::ConnectorError::CurrencyNotSupported { .. }| errors::ConnectorError::ProcessingStepFailed(None)- | errors::ConnectorError::AmountConversionFailed { .. } => {+ | errors::ConnectorError::AmountConversionFailed { .. }+ | errors::ConnectorError::GenericError { .. } => {logger::error!(%error,"Setup Mandate flow failed");errors::ApiErrorResponse::PaymentAuthorizationFailed { data: None }}diff --git a/crates/router/src/services/connector_integration_interface.rs b/crates/router/src/services/connector_integration_interface.rsindex 6b22d5ebf4..a597ddfe15 100644--- a/crates/router/src/services/connector_integration_interface.rs+++ b/crates/router/src/services/connector_integration_interface.rs@@ -439,71 +439,6 @@ impl api::ConnectorCommon for ConnectorEnum {}}-impl<T, ResourceCommonData, Req, Resp> api::ConnectorCommon- for ConnectorIntegrationEnum<'_, T, ResourceCommonData, Req, Resp>-{- fn id(&self) -> &'static str {- match self {- ConnectorIntegrationEnum::Old(old_integration) => old_integration.id(),- ConnectorIntegrationEnum::New(new_integration) => new_integration.id(),- }- }-- fn get_currency_unit(&self) -> CurrencyUnit {- match self {- ConnectorIntegrationEnum::Old(old_integration) => old_integration.get_currency_unit(),- ConnectorIntegrationEnum::New(new_integration) => new_integration.get_currency_unit(),- }- }-- fn get_auth_header(- &self,- auth_type: &types::ConnectorAuthType,- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {- match self {- ConnectorIntegrationEnum::Old(old_integration) => {- old_integration.get_auth_header(auth_type)- }- ConnectorIntegrationEnum::New(new_integration) => {- new_integration.get_auth_header(auth_type)- }- }- }-- fn common_get_content_type(&self) -> &'static str {- match self {- ConnectorIntegrationEnum::Old(old_integration) => {- old_integration.common_get_content_type()- }- ConnectorIntegrationEnum::New(new_integration) => {- new_integration.common_get_content_type()- }- }- }-- fn base_url<'a>(&self, connectors: &'a Connectors) -> &'a str {- match self {- ConnectorIntegrationEnum::Old(old_integration) => old_integration.base_url(connectors),- ConnectorIntegrationEnum::New(new_integration) => new_integration.base_url(connectors),- }- }-- fn build_error_response(- &self,- res: types::Response,- event_builder: Option<&mut ConnectorEvent>,- ) -> CustomResult<types::ErrorResponse, errors::ConnectorError> {- match self {- ConnectorIntegrationEnum::Old(old_integration) => {- old_integration.build_error_response(res, event_builder)- }- ConnectorIntegrationEnum::New(new_integration) => {- new_integration.build_error_response(res, event_builder)- }- }- }-}-pub trait ConnectorIntegrationInterface<F, ResourceCommonData, Req, Resp>: Send + Sync {fn clone_box(&self,diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rsindex 40ba7cc7cf..5fb945daf8 100644--- a/crates/router/src/types/api.rs+++ b/crates/router/src/types/api.rs@@ -94,57 +94,37 @@ pub trait Router {}pub trait Connector:Send+ Refund- + RefundV2+ Payment- + PaymentV2+ ConnectorRedirectResponse+ IncomingWebhook+ ConnectorAccessToken- + ConnectorAccessTokenV2+ Dispute- + DisputeV2+ FileUpload- + FileUploadV2+ ConnectorTransactionId+ Payouts- + PayoutsV2+ ConnectorVerifyWebhookSource- + ConnectorVerifyWebhookSourceV2+ FraudCheck- + FraudCheckV2+ ConnectorMandateRevoke- + ConnectorMandateRevokeV2+ ExternalAuthentication- + ExternalAuthenticationV2+ TaxCalculation{}impl<T: Refund- + RefundV2+ Payment- + PaymentV2+ ConnectorRedirectResponse+ Send+ IncomingWebhook+ ConnectorAccessToken- + ConnectorAccessTokenV2+ Dispute- + DisputeV2+ FileUpload- + FileUploadV2+ ConnectorTransactionId+ Payouts- + PayoutsV2+ ConnectorVerifyWebhookSource- + ConnectorVerifyWebhookSourceV2+ FraudCheck- + FraudCheckV2+ ConnectorMandateRevoke- + ConnectorMandateRevokeV2+ ExternalAuthentication- + ExternalAuthenticationV2+ TaxCalculation,> Connector for T{