diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index 1151ad5947..c94667f5fb 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -16,7 +16,7 @@ use crate::{ }; #[inline] -fn create_merchant_api_key() -> String { +pub fn create_merchant_api_key() -> String { let id = Uuid::new_v4().simple(); match env::which() { Env::Development => format!("dev_{id}"), diff --git a/crates/router/src/core/errors.rs b/crates/router/src/core/errors.rs index d10a58175b..4c0687fa50 100644 --- a/crates/router/src/core/errors.rs +++ b/crates/router/src/core/errors.rs @@ -1,6 +1,6 @@ -pub(crate) mod api_error_response; -pub(crate) mod error_handlers; -pub(crate) mod utils; +pub mod api_error_response; +pub mod error_handlers; +pub mod utils; use std::fmt::Display; @@ -12,8 +12,10 @@ pub use redis_interface::errors::RedisError; use router_env::opentelemetry::metrics::MetricsError; use storage_models::errors as storage_errors; -pub use self::api_error_response::ApiErrorResponse; -pub(crate) use self::utils::{ConnectorErrorExt, StorageErrorExt}; +pub use self::{ + api_error_response::ApiErrorResponse, + utils::{ConnectorErrorExt, StorageErrorExt}, +}; use crate::services; pub type RouterResult = CustomResult; pub type RouterResponse = CustomResult, ApiErrorResponse>; diff --git a/crates/router/src/core/errors/utils.rs b/crates/router/src/core/errors/utils.rs index b27ad326d4..c60f7a418d 100644 --- a/crates/router/src/core/errors/utils.rs +++ b/crates/router/src/core/errors/utils.rs @@ -1,6 +1,6 @@ use crate::{core::errors, logger}; -pub(crate) trait StorageErrorExt { +pub trait StorageErrorExt { fn to_not_found_response( self, not_found_response: errors::ApiErrorResponse, @@ -40,7 +40,7 @@ impl StorageErrorExt for error_stack::Report { } } -pub(crate) trait ConnectorErrorExt { +pub trait ConnectorErrorExt { fn to_refund_failed_response(self) -> error_stack::Report; fn to_payment_failed_response(self) -> error_stack::Report; fn to_verify_failed_response(self) -> error_stack::Report; @@ -115,7 +115,7 @@ impl ConnectorErrorExt for error_stack::Report { } } -pub(crate) trait RedisErrorExt { +pub trait RedisErrorExt { fn to_redis_failed_response(self, key: &str) -> error_stack::Report; } diff --git a/crates/router/src/utils.rs b/crates/router/src/utils.rs index c39c314fa8..bf8ddb57aa 100644 --- a/crates/router/src/utils.rs +++ b/crates/router/src/utils.rs @@ -1,11 +1,11 @@ -pub(crate) mod custom_serde; -pub(crate) mod db_utils; -mod ext_traits; +pub mod custom_serde; +pub mod db_utils; +pub mod ext_traits; #[cfg(feature = "kv_store")] -pub(crate) mod storage_partitioning; +pub mod storage_partitioning; -pub(crate) use common_utils::{ +pub use common_utils::{ crypto, ext_traits::{ByteSliceExt, BytesExt, Encode, StringExt, ValueExt}, fp_utils::when, @@ -15,7 +15,7 @@ use error_stack::{IntoReport, ResultExt}; use nanoid::nanoid; use serde::de::DeserializeOwned; -pub(crate) use self::ext_traits::{OptionExt, ValidateCall}; +pub use self::ext_traits::{OptionExt, ValidateCall}; use crate::{ consts, core::errors::{self, RouterResult}, diff --git a/crates/router/src/utils/ext_traits.rs b/crates/router/src/utils/ext_traits.rs index e686751bcc..5e7d42107c 100644 --- a/crates/router/src/utils/ext_traits.rs +++ b/crates/router/src/utils/ext_traits.rs @@ -6,7 +6,7 @@ use crate::{ utils::when, }; -pub(crate) trait OptionExt { +pub trait OptionExt { fn check_value_present(&self, field_name: &str) -> RouterResult<()>; fn get_required_value(self, field_name: &str) -> RouterResult;