From 138738bf4459953cb5421f60b8ffc4ca6968ea21 Mon Sep 17 00:00:00 2001 From: "hyperswitch-bot[bot]" <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Date: Fri, 27 Dec 2024 05:36:47 +0000 Subject: [PATCH] chore: run formatter --- .../src/connectors/bankofamerica.rs | 22 ++-- .../connectors/bankofamerica/transformers.rs | 29 +++-- .../src/connectors/cybersource.rs | 21 ++-- .../connectors/cybersource/transformers.rs | 8 +- .../src/connectors/wellsfargo.rs | 7 +- .../src/connectors/wellsfargo/transformers.rs | 24 ++-- .../src/default_implementations_v2.rs | 105 +++++++++++------- crates/hyperswitch_connectors/src/types.rs | 5 +- crates/hyperswitch_domain_models/src/types.rs | 1 - 9 files changed, 118 insertions(+), 104 deletions(-) diff --git a/crates/hyperswitch_connectors/src/connectors/bankofamerica.rs b/crates/hyperswitch_connectors/src/connectors/bankofamerica.rs index c4c026b8fe21..8665007a5805 100644 --- a/crates/hyperswitch_connectors/src/connectors/bankofamerica.rs +++ b/crates/hyperswitch_connectors/src/connectors/bankofamerica.rs @@ -1,10 +1,7 @@ pub mod transformers; -use crate::{ - constants::headers, - types::ResponseRouterData, - utils::{self, PaymentMethodDataType, RefundsRequestData}, -}; +use std::fmt::Debug; + use base64::Engine; use common_enums::enums; use common_utils::{ @@ -14,7 +11,6 @@ use common_utils::{ request::{Method, Request, RequestBuilder, RequestContent}, }; use error_stack::{report, ResultExt}; -use hyperswitch_domain_models::types::RefundsRouterData; use hyperswitch_domain_models::{ payment_method_data::PaymentMethodData, router_data::{AccessToken, ErrorResponse, RouterData}, @@ -31,11 +27,14 @@ use hyperswitch_domain_models::{ router_response_types::{PaymentsResponseData, RefundsResponseData}, types::{ PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData, - PaymentsSyncRouterData, RefundSyncRouterData, SetupMandateRouterData, + PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData, SetupMandateRouterData, }, }; use hyperswitch_interfaces::{ - api::{self, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorValidation,ConnectorSpecifications}, + api::{ + self, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorSpecifications, + ConnectorValidation, + }, configs::Connectors, errors, events::connector_api_logs::ConnectorEvent, @@ -47,11 +46,16 @@ use hyperswitch_interfaces::{ }; use masking::{ExposeInterface, Mask, Maskable, PeekInterface}; use ring::{digest, hmac}; -use std::fmt::Debug; use time::OffsetDateTime; use transformers as bankofamerica; use url::Url; +use crate::{ + constants::headers, + types::ResponseRouterData, + utils::{self, PaymentMethodDataType, RefundsRequestData}, +}; + pub const V_C_MERCHANT_ID: &str = "v-c-merchant-id"; #[derive(Debug, Clone)] diff --git a/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs b/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs index 97026edf7983..e22d0976f662 100644 --- a/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs @@ -1,20 +1,6 @@ -use crate::{ - types::{RefundsResponseRouterData, ResponseRouterData}, - unimplemented_payment_method, - utils::{ - self, AddressDetailsData, ApplePayDecrypt, CardData, PaymentsAuthorizeRequestData, - PaymentsSetupMandateRequestData, PaymentsSyncRequestData, RecurringMandateData, - RouterData as OtherRouterData, - }, -}; use base64::Engine; use common_enums::{enums, FutureUsage}; -use common_utils::consts; -use common_utils::pii; -use masking::{ExposeInterface, PeekInterface, Secret}; -use serde::{Deserialize, Serialize}; -use serde_json::Value; - +use common_utils::{consts, pii}; use hyperswitch_domain_models::{ payment_method_data::{ApplePayWalletData, GooglePayWalletData, PaymentMethodData, WalletData}, router_data::{ @@ -33,6 +19,19 @@ use hyperswitch_domain_models::{ }, }; use hyperswitch_interfaces::{api, errors}; +use masking::{ExposeInterface, PeekInterface, Secret}; +use serde::{Deserialize, Serialize}; +use serde_json::Value; + +use crate::{ + types::{RefundsResponseRouterData, ResponseRouterData}, + unimplemented_payment_method, + utils::{ + self, AddressDetailsData, ApplePayDecrypt, CardData, PaymentsAuthorizeRequestData, + PaymentsSetupMandateRequestData, PaymentsSyncRequestData, RecurringMandateData, + RouterData as OtherRouterData, + }, +}; pub struct BankOfAmericaAuthType { pub(super) api_key: Secret, pub(super) merchant_account: Secret, diff --git a/crates/hyperswitch_connectors/src/connectors/cybersource.rs b/crates/hyperswitch_connectors/src/connectors/cybersource.rs index 045301f727c2..09a0f623c538 100644 --- a/crates/hyperswitch_connectors/src/connectors/cybersource.rs +++ b/crates/hyperswitch_connectors/src/connectors/cybersource.rs @@ -2,25 +2,14 @@ pub mod transformers; use base64::Engine; use common_enums::enums; -use common_utils::types::{ - AmountConvertor, MinorUnit, StringMajorUnit, StringMajorUnitForConnector, -}; use common_utils::{ consts, errors::CustomResult, ext_traits::BytesExt, request::{Method, Request, RequestBuilder, RequestContent}, + types::{AmountConvertor, MinorUnit, StringMajorUnit, StringMajorUnitForConnector}, }; use error_stack::{report, Report, ResultExt}; -#[cfg(feature = "payouts")] -use hyperswitch_domain_models::{ - router_flow_types::payouts::PoFulfill, - router_response_types::PayoutsResponseData, - types::{PayoutsData, PayoutsRouterData}, -}; -#[cfg(feature = "payouts")] -use hyperswitch_interfaces::types::PayoutFulfillType; - use hyperswitch_domain_models::{ payment_method_data::PaymentMethodData, router_data::{AccessToken, ErrorResponse, RouterData}, @@ -49,6 +38,14 @@ use hyperswitch_domain_models::{ SetupMandateRouterData, }, }; +#[cfg(feature = "payouts")] +use hyperswitch_domain_models::{ + router_flow_types::payouts::PoFulfill, + router_response_types::PayoutsResponseData, + types::{PayoutsData, PayoutsRouterData}, +}; +#[cfg(feature = "payouts")] +use hyperswitch_interfaces::types::PayoutFulfillType; use hyperswitch_interfaces::{ api::{ self, diff --git a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs index 852b8fa63cfe..56f9ba2cc706 100644 --- a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs @@ -1,7 +1,6 @@ use api_models::payments; #[cfg(feature = "payouts")] use api_models::payouts::PayoutMethodData; - use base64::Engine; use common_enums::{enums, FutureUsage}; use common_utils::{ @@ -45,19 +44,16 @@ use hyperswitch_domain_models::{ PaymentsPreProcessingRouterData, RefundsRouterData, SetupMandateRouterData, }, }; - use hyperswitch_interfaces::{api, errors}; use masking::{ExposeInterface, PeekInterface, Secret}; use serde::{Deserialize, Serialize}; use serde_json::Value; use utils::ForeignTryFrom; -#[cfg(feature = "payouts")] -use crate::utils::PayoutsData; - #[cfg(feature = "payouts")] use crate::types::PayoutsResponseRouterData; - +#[cfg(feature = "payouts")] +use crate::utils::PayoutsData; use crate::{ types::{RefundsResponseRouterData, ResponseRouterData}, unimplemented_payment_method, diff --git a/crates/hyperswitch_connectors/src/connectors/wellsfargo.rs b/crates/hyperswitch_connectors/src/connectors/wellsfargo.rs index 11964a587286..93dee38006c5 100644 --- a/crates/hyperswitch_connectors/src/connectors/wellsfargo.rs +++ b/crates/hyperswitch_connectors/src/connectors/wellsfargo.rs @@ -2,14 +2,12 @@ pub mod transformers; use base64::Engine; use common_enums::enums; -use common_utils::types::{ - AmountConvertor, MinorUnit, StringMajorUnit, StringMajorUnitForConnector, -}; use common_utils::{ consts, errors::CustomResult, ext_traits::BytesExt, request::{Method, Request, RequestBuilder, RequestContent}, + types::{AmountConvertor, MinorUnit, StringMajorUnit, StringMajorUnitForConnector}, }; use error_stack::{report, Report, ResultExt}; use hyperswitch_domain_models::{ @@ -42,7 +40,8 @@ use hyperswitch_interfaces::{ api::{ self, refunds::{Refund, RefundExecute, RefundSync}, - ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorValidation,ConnectorSpecifications + ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorSpecifications, + ConnectorValidation, }, configs::Connectors, errors, diff --git a/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs b/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs index 2d21028ca848..bbf732f06944 100644 --- a/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs @@ -1,17 +1,5 @@ use api_models::payments; use base64::Engine; -use masking::{ExposeInterface, PeekInterface, Secret}; -use serde_json::Value; - -use crate::{ - types::{RefundsResponseRouterData, ResponseRouterData}, - unimplemented_payment_method, - utils::{ - self, AddressDetailsData, ApplePayDecrypt, CardData, PaymentsAuthorizeRequestData, - PaymentsSetupMandateRequestData, PaymentsSyncRequestData, RecurringMandateData, - RouterData as OtherRouterData, - }, -}; use common_enums::{enums, FutureUsage}; use common_utils::{ consts, pii, @@ -41,7 +29,19 @@ use hyperswitch_domain_models::{ }, }; use hyperswitch_interfaces::{api, errors}; +use masking::{ExposeInterface, PeekInterface, Secret}; use serde::{Deserialize, Serialize}; +use serde_json::Value; + +use crate::{ + types::{RefundsResponseRouterData, ResponseRouterData}, + unimplemented_payment_method, + utils::{ + self, AddressDetailsData, ApplePayDecrypt, CardData, PaymentsAuthorizeRequestData, + PaymentsSetupMandateRequestData, PaymentsSyncRequestData, RecurringMandateData, + RouterData as OtherRouterData, + }, +}; #[derive(Debug, Serialize)] pub struct WellsfargoRouterData { diff --git a/crates/hyperswitch_connectors/src/default_implementations_v2.rs b/crates/hyperswitch_connectors/src/default_implementations_v2.rs index ca4ace954cdc..485ff86d7284 100644 --- a/crates/hyperswitch_connectors/src/default_implementations_v2.rs +++ b/crates/hyperswitch_connectors/src/default_implementations_v2.rs @@ -257,8 +257,9 @@ default_imp_for_new_connector_integration_payment!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -403,8 +404,9 @@ default_imp_for_new_connector_integration_connector_access_token!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -478,8 +480,9 @@ default_imp_for_new_connector_integration_accept_dispute!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -552,8 +555,9 @@ default_imp_for_new_connector_integration_submit_evidence!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -627,8 +631,9 @@ default_imp_for_new_connector_integration_defend_dispute!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -712,8 +717,9 @@ default_imp_for_new_connector_integration_file_upload!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -789,8 +795,9 @@ default_imp_for_new_connector_integration_payouts_create!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -866,8 +873,9 @@ default_imp_for_new_connector_integration_payouts_eligibility!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -943,8 +951,9 @@ default_imp_for_new_connector_integration_payouts_fulfill!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1020,8 +1029,9 @@ default_imp_for_new_connector_integration_payouts_cancel!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1097,8 +1107,9 @@ default_imp_for_new_connector_integration_payouts_quote!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1174,8 +1185,9 @@ default_imp_for_new_connector_integration_payouts_recipient!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1251,8 +1263,9 @@ default_imp_for_new_connector_integration_payouts_sync!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1328,8 +1341,9 @@ default_imp_for_new_connector_integration_payouts_recipient_account!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1403,8 +1417,9 @@ default_imp_for_new_connector_integration_webhook_source_verification!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1480,8 +1495,9 @@ default_imp_for_new_connector_integration_frm_sale!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1557,8 +1573,9 @@ default_imp_for_new_connector_integration_frm_checkout!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1634,8 +1651,9 @@ default_imp_for_new_connector_integration_frm_transaction!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1711,8 +1729,9 @@ default_imp_for_new_connector_integration_frm_fulfillment!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1788,8 +1807,9 @@ default_imp_for_new_connector_integration_frm_record_return!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); @@ -1862,8 +1882,9 @@ default_imp_for_new_connector_integration_revoking_mandates!( connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, -connectors::Worldpay, -connectors::Wellsfargo, connectors::Xendit, + connectors::Worldpay, + connectors::Wellsfargo, + connectors::Xendit, connectors::Zen, connectors::Zsl ); diff --git a/crates/hyperswitch_connectors/src/types.rs b/crates/hyperswitch_connectors/src/types.rs index 6aa76f4d22d1..f731450f386c 100644 --- a/crates/hyperswitch_connectors/src/types.rs +++ b/crates/hyperswitch_connectors/src/types.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "payouts")] +use hyperswitch_domain_models::types::{PayoutsData, PayoutsResponseData}; use hyperswitch_domain_models::{ router_data::{AccessToken, RouterData}, router_flow_types::{AccessTokenAuth, Capture, PSync, PreProcessing, Session, Void}, @@ -8,9 +10,6 @@ use hyperswitch_domain_models::{ router_response_types::{PaymentsResponseData, RefundsResponseData}, }; -#[cfg(feature = "payouts")] -use hyperswitch_domain_models::types::{PayoutsData, PayoutsResponseData}; - pub(crate) type PaymentsSyncResponseRouterData = ResponseRouterData; diff --git a/crates/hyperswitch_domain_models/src/types.rs b/crates/hyperswitch_domain_models/src/types.rs index f8da4bbad28c..4bbab24edfeb 100644 --- a/crates/hyperswitch_domain_models/src/types.rs +++ b/crates/hyperswitch_domain_models/src/types.rs @@ -25,7 +25,6 @@ use crate::{ TaxCalculationResponseData, }, }; - #[cfg(feature = "payouts")] pub use crate::{router_request_types::PayoutsData, router_response_types::PayoutsResponseData};