diff --git a/crates/analytics/src/sqlx.rs b/crates/analytics/src/sqlx.rs index 926c28684e..c7b704d0e8 100644 --- a/crates/analytics/src/sqlx.rs +++ b/crates/analytics/src/sqlx.rs @@ -112,7 +112,7 @@ where fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, - ) -> Result> { + ) -> Result> { >::encode(self.0.to_string(), buf) } fn size_hint(&self) -> usize { diff --git a/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs index ebc244832b..02ea56b6d3 100644 --- a/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs @@ -115,12 +115,6 @@ struct CreditCardDetails { card_code: Option>, } -#[derive(Serialize, Deserialize, Debug)] -#[serde(rename_all = "camelCase")] -struct BankAccountDetails { - account_number: Secret, -} - #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] enum PaymentDetails { diff --git a/crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs b/crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs index 056e546db2..dcda455e2b 100644 --- a/crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs +++ b/crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs @@ -287,13 +287,6 @@ pub enum UsageMode { UseNetworkToken, } -#[derive(Default, Debug, Serialize, Deserialize)] -pub struct GlobalPayPayer { - /// Unique identifier for the Payer on the Global Payments system. - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub payer_id: Option, -} - #[derive(Default, Debug, Serialize)] pub struct GlobalPayPaymentMethodsRequest { pub reference: String, diff --git a/crates/hyperswitch_connectors/src/connectors/globalpay/response.rs b/crates/hyperswitch_connectors/src/connectors/globalpay/response.rs index daa629641e..89f5da8ba1 100644 --- a/crates/hyperswitch_connectors/src/connectors/globalpay/response.rs +++ b/crates/hyperswitch_connectors/src/connectors/globalpay/response.rs @@ -49,19 +49,6 @@ pub struct Card { pub brand_reference: Option>, } -/// A string used to identify the payment method provider being used to execute this -/// transaction. -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum ApmProvider { - Giropay, - Ideal, - Paypal, - Sofort, - Eps, - Testpay, -} - /// Indicates where a transaction is in its lifecycle. #[derive(Clone, Copy, Debug, Serialize, Deserialize)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] @@ -112,18 +99,6 @@ pub enum GlobalpayWebhookStatus { Unknown, } -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "SCREAMING_SNAKE_CASE")] -pub enum GlobalpayPaymentMethodStatus { - /// The entity is ACTIVE and can be used. - Active, - /// The entity is INACTIVE and cannot be used. - Inactive, - /// The status is DELETED. Once returned in an action response for a resource. - /// The resource has been removed from the platform. - Delete, -} - #[derive(Debug, Serialize, Deserialize)] pub struct GlobalpayPaymentMethodsResponse { #[serde(rename = "id")] diff --git a/crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs index b4cd758ef6..2cf30de8ed 100644 --- a/crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs @@ -417,12 +417,6 @@ pub struct NexixpayCard { cvv: Secret, } -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -struct Recurrence { - action: String, -} - #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PaymentsResponse { diff --git a/crates/hyperswitch_connectors/src/connectors/payload/responses.rs b/crates/hyperswitch_connectors/src/connectors/payload/responses.rs index 888213be52..f04e6b73a6 100644 --- a/crates/hyperswitch_connectors/src/connectors/payload/responses.rs +++ b/crates/hyperswitch_connectors/src/connectors/payload/responses.rs @@ -49,14 +49,6 @@ pub struct PayloadCardsResponseData { pub response_type: Option, } -#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)] -pub struct PayloadCardResponse { - pub card_brand: String, - pub card_number: String, // Masked card number like "xxxxxxxxxxxx4242" - pub card_type: String, - pub expiry: Secret, -} - // Type definition for Refund Response // Added based on assumptions since this is not provided in the documentation #[derive(Debug, Copy, Serialize, Default, Deserialize, Clone)] diff --git a/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs b/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs index 4df231a918..c23bc40a97 100644 --- a/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs +++ b/crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs @@ -163,7 +163,7 @@ impl TryFrom<&FrmSaleRouterData> for SignifydPaymentsSaleRequest { item_is_digital: order_detail .product_type .as_ref() - .map(|product| (product == &common_enums::ProductType::Digital)), + .map(|product| product == &common_enums::ProductType::Digital), }) .collect::>(); let metadata: SignifydFrmMetadata = item @@ -397,7 +397,7 @@ impl TryFrom<&FrmCheckoutRouterData> for SignifydPaymentsCheckoutRequest { item_is_digital: order_detail .product_type .as_ref() - .map(|product| (product == &common_enums::ProductType::Digital)), + .map(|product| product == &common_enums::ProductType::Digital), }) .collect::>(); let metadata: SignifydFrmMetadata = item diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs index a43ffb7cfa..d8aeea2b3b 100644 --- a/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs +++ b/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs @@ -161,16 +161,6 @@ pub struct BillingAddress { pub country_code: common_enums::CountryAlpha2, } -#[derive( - Clone, Copy, Default, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, -)] -#[serde(rename_all = "camelCase")] -pub enum Channel { - #[default] - Ecom, - Moto, -} - #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Customer { diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs index b1a3a86a04..3f684a694d 100644 --- a/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs +++ b/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs @@ -258,11 +258,6 @@ pub struct EventLinks { pub events: Option, } -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct PaymentLink { - pub href: String, -} - pub fn get_resource_id( response: WorldpayPaymentsResponse, connector_transaction_id: Option, @@ -455,19 +450,5 @@ pub struct WorldpayWebhookEventType { pub event_details: EventDetails, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] -#[serde(rename_all = "camelCase")] -pub enum WorldpayWebhookStatus { - SentForSettlement, - Authorized, - SentForAuthorization, - Cancelled, - Error, - Expired, - Refused, - SentForRefund, - RefundFailed, -} - /// Worldpay's unique reference ID for a request pub(super) const WP_CORRELATION_ID: &str = "WP-CorrelationId"; diff --git a/crates/router/src/core/fraud_check/operation.rs b/crates/router/src/core/fraud_check/operation.rs index 4750fd1117..b1b9540d9c 100644 --- a/crates/router/src/core/fraud_check/operation.rs +++ b/crates/router/src/core/fraud_check/operation.rs @@ -22,7 +22,7 @@ pub trait FraudCheckOperation: Send + std::fmt::Debug { Err(report!(errors::ApiErrorResponse::InternalServerError)) .attach_printable_lazy(|| format!("get tracker interface not found for {self:?}")) } - fn to_domain(&self) -> RouterResult<&(dyn Domain)> { + fn to_domain(&self) -> RouterResult<&dyn Domain> { Err(report!(errors::ApiErrorResponse::InternalServerError)) .attach_printable_lazy(|| format!("domain interface not found for {self:?}")) } diff --git a/crates/router/src/core/fraud_check/operation/fraud_check_post.rs b/crates/router/src/core/fraud_check/operation/fraud_check_post.rs index 7dbe590ca3..5ebeadf900 100644 --- a/crates/router/src/core/fraud_check/operation/fraud_check_post.rs +++ b/crates/router/src/core/fraud_check/operation/fraud_check_post.rs @@ -54,7 +54,7 @@ where fn to_get_tracker(&self) -> RouterResult<&(dyn GetTracker + Send + Sync)> { Ok(*self) } - fn to_domain(&self) -> RouterResult<&(dyn Domain)> { + fn to_domain(&self) -> RouterResult<&dyn Domain> { Ok(*self) } fn to_update_tracker(&self) -> RouterResult<&(dyn UpdateTracker + Send + Sync)> { @@ -74,7 +74,7 @@ where fn to_get_tracker(&self) -> RouterResult<&(dyn GetTracker + Send + Sync)> { Ok(self) } - fn to_domain(&self) -> RouterResult<&(dyn Domain)> { + fn to_domain(&self) -> RouterResult<&dyn Domain> { Ok(self) } fn to_update_tracker(&self) -> RouterResult<&(dyn UpdateTracker + Send + Sync)> { diff --git a/crates/router/src/core/fraud_check/operation/fraud_check_pre.rs b/crates/router/src/core/fraud_check/operation/fraud_check_pre.rs index 0c42bdeacb..829fa33311 100644 --- a/crates/router/src/core/fraud_check/operation/fraud_check_pre.rs +++ b/crates/router/src/core/fraud_check/operation/fraud_check_pre.rs @@ -45,7 +45,7 @@ where fn to_get_tracker(&self) -> RouterResult<&(dyn GetTracker + Send + Sync)> { Ok(*self) } - fn to_domain(&self) -> RouterResult<&(dyn Domain)> { + fn to_domain(&self) -> RouterResult<&dyn Domain> { Ok(*self) } fn to_update_tracker(&self) -> RouterResult<&(dyn UpdateTracker + Send + Sync)> { @@ -61,7 +61,7 @@ where fn to_get_tracker(&self) -> RouterResult<&(dyn GetTracker + Send + Sync)> { Ok(self) } - fn to_domain(&self) -> RouterResult<&(dyn Domain)> { + fn to_domain(&self) -> RouterResult<&dyn Domain> { Ok(self) } fn to_update_tracker(&self) -> RouterResult<&(dyn UpdateTracker + Send + Sync)> { diff --git a/crates/router/src/db.rs b/crates/router/src/db.rs index e43c12da15..2cead7d050 100644 --- a/crates/router/src/db.rs +++ b/crates/router/src/db.rs @@ -153,7 +153,7 @@ pub trait StorageInterface: { fn get_scheduler_db(&self) -> Box; fn get_payment_methods_store(&self) -> Box; - fn get_cache_store(&self) -> Box<(dyn RedisConnInterface + Send + Sync + 'static)>; + fn get_cache_store(&self) -> Box; } #[async_trait::async_trait] @@ -168,7 +168,7 @@ pub trait GlobalStorageInterface: + RedisConnInterface + 'static { - fn get_cache_store(&self) -> Box<(dyn RedisConnInterface + Send + Sync + 'static)>; + fn get_cache_store(&self) -> Box; } #[async_trait::async_trait] @@ -226,14 +226,14 @@ impl StorageInterface for Store { Box::new(self.clone()) } - fn get_cache_store(&self) -> Box<(dyn RedisConnInterface + Send + Sync + 'static)> { + fn get_cache_store(&self) -> Box { Box::new(self.clone()) } } #[async_trait::async_trait] impl GlobalStorageInterface for Store { - fn get_cache_store(&self) -> Box<(dyn RedisConnInterface + Send + Sync + 'static)> { + fn get_cache_store(&self) -> Box { Box::new(self.clone()) } } @@ -249,14 +249,14 @@ impl StorageInterface for MockDb { Box::new(self.clone()) } - fn get_cache_store(&self) -> Box<(dyn RedisConnInterface + Send + Sync + 'static)> { + fn get_cache_store(&self) -> Box { Box::new(self.clone()) } } #[async_trait::async_trait] impl GlobalStorageInterface for MockDb { - fn get_cache_store(&self) -> Box<(dyn RedisConnInterface + Send + Sync + 'static)> { + fn get_cache_store(&self) -> Box { Box::new(self.clone()) } } diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs index 68ef8d1961..8bbee6ab8c 100644 --- a/crates/router/src/db/kafka_store.rs +++ b/crates/router/src/db/kafka_store.rs @@ -3316,13 +3316,13 @@ impl StorageInterface for KafkaStore { Box::new(self.clone()) } - fn get_cache_store(&self) -> Box<(dyn RedisConnInterface + Send + Sync + 'static)> { + fn get_cache_store(&self) -> Box { Box::new(self.clone()) } } impl GlobalStorageInterface for KafkaStore { - fn get_cache_store(&self) -> Box<(dyn RedisConnInterface + Send + Sync + 'static)> { + fn get_cache_store(&self) -> Box { Box::new(self.clone()) } } diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index 0d7da850f1..696f47a4c0 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -233,7 +233,7 @@ impl SessionStateInfo for SessionState { fn session_state(&self) -> SessionState { self.clone() } - fn global_store(&self) -> Box<(dyn GlobalStorageInterface)> { + fn global_store(&self) -> Box { self.global_store.to_owned() } } diff --git a/crates/router/src/services/api/client.rs b/crates/router/src/services/api/client.rs index d690ebd327..9e54e673b9 100644 --- a/crates/router/src/services/api/client.rs +++ b/crates/router/src/services/api/client.rs @@ -24,10 +24,7 @@ pub trait RequestBuilder: Send + Sync { fn send( self, ) -> CustomResult< - Box< - (dyn core::future::Future> - + 'static), - >, + Box> + 'static>, ApiClientError, >; } @@ -154,10 +151,7 @@ impl RequestBuilder for RouterRequestBuilder { fn send( self, ) -> CustomResult< - Box< - (dyn core::future::Future> - + 'static), - >, + Box> + 'static>, ApiClientError, > { Ok(Box::new(