From 9b6528fd7287848517c33f0aa1fd8115d6f47369 Mon Sep 17 00:00:00 2001 From: sumanmaji4 Date: Tue, 3 Dec 2024 17:56:39 +0530 Subject: [PATCH 1/3] unifiedauthenticationservice template --- config/config.example.toml | 1 + config/deployments/integration_test.toml | 1 + config/deployments/production.toml | 1 + config/deployments/sandbox.toml | 1 + config/development.toml | 2 + config/docker_compose.toml | 2 + crates/api_models/src/connector_enums.rs | 2 + crates/common_enums/src/connector_enums.rs | 1 + .../hyperswitch_connectors/src/connectors.rs | 5 +- .../unifiedauthenticationservice.rs | 599 ++++++++++++++++++ .../transformers.rs | 246 +++++++ .../src/default_implementations.rs | 32 + .../src/default_implementations_v2.rs | 22 + crates/hyperswitch_interfaces/src/configs.rs | 1 + crates/router/src/connector.rs | 3 +- .../connector_integration_v2_impls.rs | 3 + crates/router/src/core/payments/flows.rs | 3 + crates/router/src/types/api.rs | 4 +- crates/router/src/types/transformers.rs | 3 + crates/router/tests/connectors/main.rs | 1 + .../router/tests/connectors/sample_auth.toml | 3 + .../unifiedauthenticationservice.rs | 421 ++++++++++++ crates/test_utils/src/connector_auth.rs | 1 + loadtest/config/development.toml | 2 + scripts/add_connector.sh | 2 +- 25 files changed, 1357 insertions(+), 5 deletions(-) create mode 100644 crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice.rs create mode 100644 crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice/transformers.rs create mode 100644 crates/router/tests/connectors/unifiedauthenticationservice.rs diff --git a/config/config.example.toml b/config/config.example.toml index 54a3ab3827bd..81bf31a1827e 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -267,6 +267,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" +unifiedauthenticationservice.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml index fbf80ced5f17..ba14092e6825 100644 --- a/config/deployments/integration_test.toml +++ b/config/deployments/integration_test.toml @@ -107,6 +107,7 @@ thunes.base_url = "https://api.limonetikqualif.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" +unifiedauthenticationservice.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" diff --git a/config/deployments/production.toml b/config/deployments/production.toml index befd70795d7d..6ae91f579058 100644 --- a/config/deployments/production.toml +++ b/config/deployments/production.toml @@ -111,6 +111,7 @@ thunes.base_url = "https://api.limonetik.com/" trustpay.base_url = "https://tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://gateway.transit-pass.com/" +unifiedauthenticationservice.base_url = "http://localhost:8000" volt.base_url = "https://api.volt.io/" wellsfargo.base_url = "https://api.cybersource.com/" wellsfargopayout.base_url = "https://api.wellsfargo.com/" diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index 2defc5729cf2..cfed74a20077 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -111,6 +111,7 @@ thunes.base_url = "https://api.limonetikqualif.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" +unifiedauthenticationservice.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" diff --git a/config/development.toml b/config/development.toml index 4e3a9b099938..d41a93b12ff4 100644 --- a/config/development.toml +++ b/config/development.toml @@ -165,6 +165,7 @@ cards = [ "thunes", "trustpay", "tsys", + "unifiedauthenticationservice", "volt", "wellsfargo", "wellsfargopayout", @@ -287,6 +288,7 @@ worldpay.base_url = "https://try.access.worldpay.com/" xendit.base_url = "https://api.xendit.co" trustpay.base_url = "https://test-tpgw.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" +unifiedauthenticationservice.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" diff --git a/config/docker_compose.toml b/config/docker_compose.toml index f38da4183b1a..64bb951840c5 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -198,6 +198,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" +unifiedauthenticationservice.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" @@ -287,6 +288,7 @@ cards = [ "thunes", "trustpay", "tsys", + "unifiedauthenticationservice", "volt", "wellsfargo", "wellsfargopayout", diff --git a/crates/api_models/src/connector_enums.rs b/crates/api_models/src/connector_enums.rs index 4931b8dbd922..6557841f11ce 100644 --- a/crates/api_models/src/connector_enums.rs +++ b/crates/api_models/src/connector_enums.rs @@ -123,6 +123,7 @@ pub enum Connector { //Thunes, Trustpay, Tsys, + // Unifiedauthenticationservice, Volt, Wellsfargo, // Wellsfargopayout, @@ -260,6 +261,7 @@ impl Connector { // | Self::Thunes | Self::Trustpay | Self::Tsys + // | Self::Unifiedauthenticationservice | Self::Volt | Self::Wellsfargo // | Self::Wellsfargopayout diff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rs index 421a51205dea..1b656e86376a 100644 --- a/crates/common_enums/src/connector_enums.rs +++ b/crates/common_enums/src/connector_enums.rs @@ -120,6 +120,7 @@ pub enum RoutableConnectors { // Thunes // Tsys, Tsys, + // Unifiedauthenticationservice, Volt, Wellsfargo, // Wellsfargopayout, diff --git a/crates/hyperswitch_connectors/src/connectors.rs b/crates/hyperswitch_connectors/src/connectors.rs index 5b7075cd680a..cc4ac6703376 100644 --- a/crates/hyperswitch_connectors/src/connectors.rs +++ b/crates/hyperswitch_connectors/src/connectors.rs @@ -40,6 +40,7 @@ pub mod stax; pub mod taxjar; pub mod thunes; pub mod tsys; +pub mod unifiedauthenticationservice; pub mod volt; pub mod worldline; pub mod worldpay; @@ -57,6 +58,6 @@ pub use self::{ nexixpay::Nexixpay, nomupay::Nomupay, novalnet::Novalnet, payeezy::Payeezy, payu::Payu, powertranz::Powertranz, prophetpay::Prophetpay, rapyd::Rapyd, razorpay::Razorpay, redsys::Redsys, shift4::Shift4, square::Square, stax::Stax, taxjar::Taxjar, thunes::Thunes, - tsys::Tsys, volt::Volt, worldline::Worldline, worldpay::Worldpay, xendit::Xendit, zen::Zen, - zsl::Zsl, + tsys::Tsys, unifiedauthenticationservice::Unifiedauthenticationservice, volt::Volt, + worldline::Worldline, worldpay::Worldpay, xendit::Xendit, zen::Zen, zsl::Zsl, }; diff --git a/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice.rs b/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice.rs new file mode 100644 index 000000000000..e00deb07222f --- /dev/null +++ b/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice.rs @@ -0,0 +1,599 @@ +pub mod transformers; + +use common_utils::{ + errors::CustomResult, + ext_traits::BytesExt, + request::{Method, Request, RequestBuilder, RequestContent}, + types::{AmountConvertor, StringMinorUnit, StringMinorUnitForConnector}, +}; +use error_stack::{report, ResultExt}; +use hyperswitch_domain_models::{ + router_data::{AccessToken, ConnectorAuthType, ErrorResponse, RouterData}, + router_flow_types::{ + access_token_auth::AccessTokenAuth, + payments::{Authorize, Capture, PSync, PaymentMethodToken, Session, SetupMandate, Void}, + refunds::{Execute, RSync}, + }, + router_request_types::{ + AccessTokenRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData, + PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData, + RefundsData, SetupMandateRequestData, + }, + router_response_types::{PaymentsResponseData, RefundsResponseData}, + types::{ + PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData, + RefundSyncRouterData, RefundsRouterData, + }, +}; +use hyperswitch_interfaces::{ + api::{self, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorValidation}, + configs::Connectors, + errors, + events::connector_api_logs::ConnectorEvent, + types::{self, Response}, + webhooks, +}; +use masking::{ExposeInterface, Mask}; +use transformers as unifiedauthenticationservice; + +use crate::{constants::headers, types::ResponseRouterData, utils}; + +#[derive(Clone)] +pub struct Unifiedauthenticationservice { + amount_converter: &'static (dyn AmountConvertor + Sync), +} + +impl Unifiedauthenticationservice { + pub fn new() -> &'static Self { + &Self { + amount_converter: &StringMinorUnitForConnector, + } + } +} + +impl api::Payment for Unifiedauthenticationservice {} +impl api::PaymentSession for Unifiedauthenticationservice {} +impl api::ConnectorAccessToken for Unifiedauthenticationservice {} +impl api::MandateSetup for Unifiedauthenticationservice {} +impl api::PaymentAuthorize for Unifiedauthenticationservice {} +impl api::PaymentSync for Unifiedauthenticationservice {} +impl api::PaymentCapture for Unifiedauthenticationservice {} +impl api::PaymentVoid for Unifiedauthenticationservice {} +impl api::Refund for Unifiedauthenticationservice {} +impl api::RefundExecute for Unifiedauthenticationservice {} +impl api::RefundSync for Unifiedauthenticationservice {} +impl api::PaymentToken for Unifiedauthenticationservice {} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ + // Not Implemented (R) +} + +impl ConnectorCommonExt + for Unifiedauthenticationservice +where + Self: ConnectorIntegration, +{ + fn build_headers( + &self, + req: &RouterData, + _connectors: &Connectors, + ) -> CustomResult)>, errors::ConnectorError> { + let mut header = vec![( + headers::CONTENT_TYPE.to_string(), + self.get_content_type().to_string().into(), + )]; + let mut api_key = self.get_auth_header(&req.connector_auth_type)?; + header.append(&mut api_key); + Ok(header) + } +} + +impl ConnectorCommon for Unifiedauthenticationservice { + fn id(&self) -> &'static str { + "unifiedauthenticationservice" + } + + fn get_currency_unit(&self) -> api::CurrencyUnit { + api::CurrencyUnit::Base + // TODO! Check connector documentation, on which unit they are processing the currency. + // If the connector accepts amount in lower unit ( i.e cents for USD) then return api::CurrencyUnit::Minor, + // if connector accepts amount in base unit (i.e dollars for USD) then return api::CurrencyUnit::Base + } + + fn common_get_content_type(&self) -> &'static str { + "application/json" + } + + fn base_url<'a>(&self, connectors: &'a Connectors) -> &'a str { + connectors.unifiedauthenticationservice.base_url.as_ref() + } + + fn get_auth_header( + &self, + auth_type: &ConnectorAuthType, + ) -> CustomResult)>, errors::ConnectorError> { + let auth = + unifiedauthenticationservice::UnifiedauthenticationserviceAuthType::try_from(auth_type) + .change_context(errors::ConnectorError::FailedToObtainAuthType)?; + Ok(vec![( + headers::AUTHORIZATION.to_string(), + auth.api_key.expose().into_masked(), + )]) + } + + fn build_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult { + let response: unifiedauthenticationservice::UnifiedauthenticationserviceErrorResponse = res + .response + .parse_struct("UnifiedauthenticationserviceErrorResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + + Ok(ErrorResponse { + status_code: res.status_code, + code: response.code, + message: response.message, + reason: response.reason, + attempt_status: None, + connector_transaction_id: None, + }) + } +} + +impl ConnectorValidation for Unifiedauthenticationservice { + //TODO: implement functions when support enabled +} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ + //TODO: implement sessions flow +} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ +} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ +} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ + fn get_headers( + &self, + req: &PaymentsAuthorizeRouterData, + connectors: &Connectors, + ) -> CustomResult)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &PaymentsAuthorizeRouterData, + _connectors: &Connectors, + ) -> CustomResult { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + req: &PaymentsAuthorizeRouterData, + _connectors: &Connectors, + ) -> CustomResult { + let amount = utils::convert_amount( + self.amount_converter, + req.request.minor_amount, + req.request.currency, + )?; + + let connector_router_data = + unifiedauthenticationservice::UnifiedauthenticationserviceRouterData::from(( + amount, req, + )); + let connector_req = + unifiedauthenticationservice::UnifiedauthenticationservicePaymentsRequest::try_from( + &connector_router_data, + )?; + Ok(RequestContent::Json(Box::new(connector_req))) + } + + fn build_request( + &self, + req: &PaymentsAuthorizeRouterData, + connectors: &Connectors, + ) -> CustomResult, errors::ConnectorError> { + Ok(Some( + RequestBuilder::new() + .method(Method::Post) + .url(&types::PaymentsAuthorizeType::get_url( + self, req, connectors, + )?) + .attach_default_headers() + .headers(types::PaymentsAuthorizeType::get_headers( + self, req, connectors, + )?) + .set_body(types::PaymentsAuthorizeType::get_request_body( + self, req, connectors, + )?) + .build(), + )) + } + + fn handle_response( + &self, + data: &PaymentsAuthorizeRouterData, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult { + let response: unifiedauthenticationservice::UnifiedauthenticationservicePaymentsResponse = + res.response + .parse_struct("Unifiedauthenticationservice PaymentsAuthorizeResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + RouterData::try_from(ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult { + self.build_error_response(res, event_builder) + } +} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ + fn get_headers( + &self, + req: &PaymentsSyncRouterData, + connectors: &Connectors, + ) -> CustomResult)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &PaymentsSyncRouterData, + _connectors: &Connectors, + ) -> CustomResult { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn build_request( + &self, + req: &PaymentsSyncRouterData, + connectors: &Connectors, + ) -> CustomResult, errors::ConnectorError> { + Ok(Some( + RequestBuilder::new() + .method(Method::Get) + .url(&types::PaymentsSyncType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::PaymentsSyncType::get_headers(self, req, connectors)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &PaymentsSyncRouterData, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult { + let response: unifiedauthenticationservice::UnifiedauthenticationservicePaymentsResponse = + res.response + .parse_struct("unifiedauthenticationservice PaymentsSyncResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + RouterData::try_from(ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult { + self.build_error_response(res, event_builder) + } +} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ + fn get_headers( + &self, + req: &PaymentsCaptureRouterData, + connectors: &Connectors, + ) -> CustomResult)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &PaymentsCaptureRouterData, + _connectors: &Connectors, + ) -> CustomResult { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + _req: &PaymentsCaptureRouterData, + _connectors: &Connectors, + ) -> CustomResult { + Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into()) + } + + fn build_request( + &self, + req: &PaymentsCaptureRouterData, + connectors: &Connectors, + ) -> CustomResult, errors::ConnectorError> { + Ok(Some( + RequestBuilder::new() + .method(Method::Post) + .url(&types::PaymentsCaptureType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::PaymentsCaptureType::get_headers( + self, req, connectors, + )?) + .set_body(types::PaymentsCaptureType::get_request_body( + self, req, connectors, + )?) + .build(), + )) + } + + fn handle_response( + &self, + data: &PaymentsCaptureRouterData, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult { + let response: unifiedauthenticationservice::UnifiedauthenticationservicePaymentsResponse = + res.response + .parse_struct("Unifiedauthenticationservice PaymentsCaptureResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + RouterData::try_from(ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult { + self.build_error_response(res, event_builder) + } +} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ +} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ + fn get_headers( + &self, + req: &RefundsRouterData, + connectors: &Connectors, + ) -> CustomResult)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &RefundsRouterData, + _connectors: &Connectors, + ) -> CustomResult { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + req: &RefundsRouterData, + _connectors: &Connectors, + ) -> CustomResult { + let refund_amount = utils::convert_amount( + self.amount_converter, + req.request.minor_refund_amount, + req.request.currency, + )?; + + let connector_router_data = + unifiedauthenticationservice::UnifiedauthenticationserviceRouterData::from(( + refund_amount, + req, + )); + let connector_req = + unifiedauthenticationservice::UnifiedauthenticationserviceRefundRequest::try_from( + &connector_router_data, + )?; + Ok(RequestContent::Json(Box::new(connector_req))) + } + + fn build_request( + &self, + req: &RefundsRouterData, + connectors: &Connectors, + ) -> CustomResult, errors::ConnectorError> { + let request = RequestBuilder::new() + .method(Method::Post) + .url(&types::RefundExecuteType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::RefundExecuteType::get_headers( + self, req, connectors, + )?) + .set_body(types::RefundExecuteType::get_request_body( + self, req, connectors, + )?) + .build(); + Ok(Some(request)) + } + + fn handle_response( + &self, + data: &RefundsRouterData, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult, errors::ConnectorError> { + let response: unifiedauthenticationservice::RefundResponse = res + .response + .parse_struct("unifiedauthenticationservice RefundResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + RouterData::try_from(ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult { + self.build_error_response(res, event_builder) + } +} + +impl ConnectorIntegration + for Unifiedauthenticationservice +{ + fn get_headers( + &self, + req: &RefundSyncRouterData, + connectors: &Connectors, + ) -> CustomResult)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &RefundSyncRouterData, + _connectors: &Connectors, + ) -> CustomResult { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn build_request( + &self, + req: &RefundSyncRouterData, + connectors: &Connectors, + ) -> CustomResult, errors::ConnectorError> { + Ok(Some( + RequestBuilder::new() + .method(Method::Get) + .url(&types::RefundSyncType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::RefundSyncType::get_headers(self, req, connectors)?) + .set_body(types::RefundSyncType::get_request_body( + self, req, connectors, + )?) + .build(), + )) + } + + fn handle_response( + &self, + data: &RefundSyncRouterData, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult { + let response: unifiedauthenticationservice::RefundResponse = res + .response + .parse_struct("unifiedauthenticationservice RefundSyncResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + RouterData::try_from(ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult { + self.build_error_response(res, event_builder) + } +} + +#[async_trait::async_trait] +impl webhooks::IncomingWebhook for Unifiedauthenticationservice { + fn get_webhook_object_reference_id( + &self, + _request: &webhooks::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult { + Err(report!(errors::ConnectorError::WebhooksNotImplemented)) + } + + fn get_webhook_event_type( + &self, + _request: &webhooks::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult { + Err(report!(errors::ConnectorError::WebhooksNotImplemented)) + } + + fn get_webhook_resource_object( + &self, + _request: &webhooks::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult, errors::ConnectorError> { + Err(report!(errors::ConnectorError::WebhooksNotImplemented)) + } +} diff --git a/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice/transformers.rs b/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice/transformers.rs new file mode 100644 index 000000000000..2cd139082402 --- /dev/null +++ b/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice/transformers.rs @@ -0,0 +1,246 @@ +use common_enums::enums; +use common_utils::types::StringMinorUnit; +use hyperswitch_domain_models::{ + payment_method_data::PaymentMethodData, + router_data::{ConnectorAuthType, RouterData}, + router_flow_types::refunds::{Execute, RSync}, + router_request_types::ResponseId, + router_response_types::{PaymentsResponseData, RefundsResponseData}, + types::{PaymentsAuthorizeRouterData, RefundsRouterData}, +}; +use hyperswitch_interfaces::errors; +use masking::Secret; +use serde::{Deserialize, Serialize}; + +use crate::{ + types::{RefundsResponseRouterData, ResponseRouterData}, + utils::PaymentsAuthorizeRequestData, +}; + +//TODO: Fill the struct with respective fields +pub struct UnifiedauthenticationserviceRouterData { + pub amount: StringMinorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc. + pub router_data: T, +} + +impl From<(StringMinorUnit, T)> for UnifiedauthenticationserviceRouterData { + fn from((amount, item): (StringMinorUnit, T)) -> Self { + //Todo : use utils to convert the amount to the type of amount that a connector accepts + Self { + amount, + router_data: item, + } + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Serialize, PartialEq)] +pub struct UnifiedauthenticationservicePaymentsRequest { + amount: StringMinorUnit, + card: UnifiedauthenticationserviceCard, +} + +#[derive(Default, Debug, Serialize, Eq, PartialEq)] +pub struct UnifiedauthenticationserviceCard { + number: cards::CardNumber, + expiry_month: Secret, + expiry_year: Secret, + cvc: Secret, + complete: bool, +} + +impl TryFrom<&UnifiedauthenticationserviceRouterData<&PaymentsAuthorizeRouterData>> + for UnifiedauthenticationservicePaymentsRequest +{ + type Error = error_stack::Report; + fn try_from( + item: &UnifiedauthenticationserviceRouterData<&PaymentsAuthorizeRouterData>, + ) -> Result { + match item.router_data.request.payment_method_data.clone() { + PaymentMethodData::Card(req_card) => { + let card = UnifiedauthenticationserviceCard { + number: req_card.card_number, + expiry_month: req_card.card_exp_month, + expiry_year: req_card.card_exp_year, + cvc: req_card.card_cvc, + complete: item.router_data.request.is_auto_capture()?, + }; + Ok(Self { + amount: item.amount.clone(), + card, + }) + } + _ => Err(errors::ConnectorError::NotImplemented("Payment method".to_string()).into()), + } + } +} + +//TODO: Fill the struct with respective fields +// Auth Struct +pub struct UnifiedauthenticationserviceAuthType { + pub(super) api_key: Secret, +} + +impl TryFrom<&ConnectorAuthType> for UnifiedauthenticationserviceAuthType { + type Error = error_stack::Report; + fn try_from(auth_type: &ConnectorAuthType) -> Result { + match auth_type { + ConnectorAuthType::HeaderKey { api_key } => Ok(Self { + api_key: api_key.to_owned(), + }), + _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()), + } + } +} +// PaymentsResponse +//TODO: Append the remaining status flags +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "lowercase")] +pub enum UnifiedauthenticationservicePaymentStatus { + Succeeded, + Failed, + #[default] + Processing, +} + +impl From for common_enums::AttemptStatus { + fn from(item: UnifiedauthenticationservicePaymentStatus) -> Self { + match item { + UnifiedauthenticationservicePaymentStatus::Succeeded => Self::Charged, + UnifiedauthenticationservicePaymentStatus::Failed => Self::Failure, + UnifiedauthenticationservicePaymentStatus::Processing => Self::Authorizing, + } + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct UnifiedauthenticationservicePaymentsResponse { + status: UnifiedauthenticationservicePaymentStatus, + id: String, +} + +impl + TryFrom< + ResponseRouterData< + F, + UnifiedauthenticationservicePaymentsResponse, + T, + PaymentsResponseData, + >, + > for RouterData +{ + type Error = error_stack::Report; + fn try_from( + item: ResponseRouterData< + F, + UnifiedauthenticationservicePaymentsResponse, + T, + PaymentsResponseData, + >, + ) -> Result { + Ok(Self { + status: common_enums::AttemptStatus::from(item.response.status), + response: Ok(PaymentsResponseData::TransactionResponse { + resource_id: ResponseId::ConnectorTransactionId(item.response.id), + redirection_data: Box::new(None), + mandate_reference: Box::new(None), + connector_metadata: None, + network_txn_id: None, + connector_response_reference_id: None, + incremental_authorization_allowed: None, + charge_id: None, + }), + ..item.data + }) + } +} + +//TODO: Fill the struct with respective fields +// REFUND : +// Type definition for RefundRequest +#[derive(Default, Debug, Serialize)] +pub struct UnifiedauthenticationserviceRefundRequest { + pub amount: StringMinorUnit, +} + +impl TryFrom<&UnifiedauthenticationserviceRouterData<&RefundsRouterData>> + for UnifiedauthenticationserviceRefundRequest +{ + type Error = error_stack::Report; + fn try_from( + item: &UnifiedauthenticationserviceRouterData<&RefundsRouterData>, + ) -> Result { + Ok(Self { + amount: item.amount.to_owned(), + }) + } +} + +// Type definition for Refund Response + +#[allow(dead_code)] +#[derive(Debug, Serialize, Default, Deserialize, Clone)] +pub enum RefundStatus { + Succeeded, + Failed, + #[default] + Processing, +} + +impl From for enums::RefundStatus { + fn from(item: RefundStatus) -> Self { + match item { + RefundStatus::Succeeded => Self::Success, + RefundStatus::Failed => Self::Failure, + RefundStatus::Processing => Self::Pending, + //TODO: Review mapping + } + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Clone, Serialize, Deserialize)] +pub struct RefundResponse { + id: String, + status: RefundStatus, +} + +impl TryFrom> for RefundsRouterData { + type Error = error_stack::Report; + fn try_from( + item: RefundsResponseRouterData, + ) -> Result { + Ok(Self { + response: Ok(RefundsResponseData { + connector_refund_id: item.response.id.to_string(), + refund_status: enums::RefundStatus::from(item.response.status), + }), + ..item.data + }) + } +} + +impl TryFrom> for RefundsRouterData { + type Error = error_stack::Report; + fn try_from( + item: RefundsResponseRouterData, + ) -> Result { + Ok(Self { + response: Ok(RefundsResponseData { + connector_refund_id: item.response.id.to_string(), + refund_status: enums::RefundStatus::from(item.response.status), + }), + ..item.data + }) + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] +pub struct UnifiedauthenticationserviceErrorResponse { + pub status_code: u16, + pub code: String, + pub message: String, + pub reason: Option, +} diff --git a/crates/hyperswitch_connectors/src/default_implementations.rs b/crates/hyperswitch_connectors/src/default_implementations.rs index b39f50bfe18f..d2baa0af9763 100644 --- a/crates/hyperswitch_connectors/src/default_implementations.rs +++ b/crates/hyperswitch_connectors/src/default_implementations.rs @@ -128,6 +128,7 @@ default_imp_for_authorize_session_token!( connectors::Shift4, connectors::Stax, connectors::Taxjar, + connectors::Unifiedauthenticationservice, connectors::Volt, connectors::Thunes, connectors::Tsys, @@ -194,6 +195,7 @@ default_imp_for_calculate_tax!( connectors::Square, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Volt, connectors::Worldline, connectors::Worldpay, @@ -251,6 +253,7 @@ default_imp_for_session_update!( connectors::Nexixpay, connectors::Payeezy, connectors::Payu, + connectors::Unifiedauthenticationservice, connectors::Fiuu, connectors::Globepay, connectors::Gocardless, @@ -326,6 +329,7 @@ default_imp_for_post_session_tokens!( connectors::Prophetpay, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Deutschebank, connectors::Volt, connectors::Zen, @@ -382,6 +386,7 @@ default_imp_for_complete_authorize!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Xendit, @@ -447,6 +452,7 @@ default_imp_for_incremental_authorization!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -511,6 +517,7 @@ default_imp_for_create_customer!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -574,6 +581,7 @@ default_imp_for_connector_redirect_response!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Xendit, @@ -634,6 +642,7 @@ default_imp_for_pre_processing_steps!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -700,6 +709,7 @@ default_imp_for_post_processing_steps!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -766,6 +776,7 @@ default_imp_for_approve!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -832,6 +843,7 @@ default_imp_for_reject!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -898,6 +910,7 @@ default_imp_for_webhook_source_verification!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -965,6 +978,7 @@ default_imp_for_accept_dispute!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1031,6 +1045,7 @@ default_imp_for_submit_evidence!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1097,6 +1112,7 @@ default_imp_for_defend_dispute!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1172,6 +1188,7 @@ default_imp_for_file_upload!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1230,6 +1247,7 @@ default_imp_for_payouts!( connectors::Stax, connectors::Taxjar, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Volt, connectors::Worldline, connectors::Worldpay, @@ -1298,6 +1316,7 @@ default_imp_for_payouts_create!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1366,6 +1385,7 @@ default_imp_for_payouts_retrieve!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1434,6 +1454,7 @@ default_imp_for_payouts_eligibility!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1502,6 +1523,7 @@ default_imp_for_payouts_fulfill!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1570,6 +1592,7 @@ default_imp_for_payouts_cancel!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1638,6 +1661,7 @@ default_imp_for_payouts_quote!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1706,6 +1730,7 @@ default_imp_for_payouts_recipient!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1774,6 +1799,7 @@ default_imp_for_payouts_recipient_account!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1842,6 +1868,7 @@ default_imp_for_frm_sale!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1910,6 +1937,7 @@ default_imp_for_frm_checkout!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1978,6 +2006,7 @@ default_imp_for_frm_transaction!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -2046,6 +2075,7 @@ default_imp_for_frm_fulfillment!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -2114,6 +2144,7 @@ default_imp_for_frm_record_return!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -2179,6 +2210,7 @@ default_imp_for_revoking_mandates!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Worldpay, connectors::Volt, diff --git a/crates/hyperswitch_connectors/src/default_implementations_v2.rs b/crates/hyperswitch_connectors/src/default_implementations_v2.rs index 60e14ca35957..aa4c4fb6c4ee 100644 --- a/crates/hyperswitch_connectors/src/default_implementations_v2.rs +++ b/crates/hyperswitch_connectors/src/default_implementations_v2.rs @@ -247,6 +247,7 @@ default_imp_for_new_connector_integration_payment!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -314,6 +315,7 @@ default_imp_for_new_connector_integration_refund!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -376,6 +378,7 @@ default_imp_for_new_connector_integration_connector_access_token!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -444,6 +447,7 @@ default_imp_for_new_connector_integration_accept_dispute!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -511,6 +515,7 @@ default_imp_for_new_connector_integration_submit_evidence!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -578,6 +583,7 @@ default_imp_for_new_connector_integration_defend_dispute!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -655,6 +661,7 @@ default_imp_for_new_connector_integration_file_upload!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -724,6 +731,7 @@ default_imp_for_new_connector_integration_payouts_create!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -793,6 +801,7 @@ default_imp_for_new_connector_integration_payouts_eligibility!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -862,6 +871,7 @@ default_imp_for_new_connector_integration_payouts_fulfill!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -931,6 +941,7 @@ default_imp_for_new_connector_integration_payouts_cancel!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1000,6 +1011,7 @@ default_imp_for_new_connector_integration_payouts_quote!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1069,6 +1081,7 @@ default_imp_for_new_connector_integration_payouts_recipient!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1138,6 +1151,7 @@ default_imp_for_new_connector_integration_payouts_sync!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1207,6 +1221,7 @@ default_imp_for_new_connector_integration_payouts_recipient_account!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1274,6 +1289,7 @@ default_imp_for_new_connector_integration_webhook_source_verification!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1343,6 +1359,7 @@ default_imp_for_new_connector_integration_frm_sale!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1412,6 +1429,7 @@ default_imp_for_new_connector_integration_frm_checkout!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1481,6 +1499,7 @@ default_imp_for_new_connector_integration_frm_transaction!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1550,6 +1569,7 @@ default_imp_for_new_connector_integration_frm_fulfillment!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1619,6 +1639,7 @@ default_imp_for_new_connector_integration_frm_record_return!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1685,6 +1706,7 @@ default_imp_for_new_connector_integration_revoking_mandates!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, + connectors::Unifiedauthenticationservice, connectors::Worldline, connectors::Volt, connectors::Worldpay, diff --git a/crates/hyperswitch_interfaces/src/configs.rs b/crates/hyperswitch_interfaces/src/configs.rs index d6e195bbec40..93cf888a4158 100644 --- a/crates/hyperswitch_interfaces/src/configs.rs +++ b/crates/hyperswitch_interfaces/src/configs.rs @@ -88,6 +88,7 @@ pub struct Connectors { pub thunes: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub tsys: ConnectorParams, + pub unifiedauthenticationservice: ConnectorParams, pub volt: ConnectorParams, pub wellsfargo: ConnectorParams, pub wellsfargopayout: ConnectorParams, diff --git a/crates/router/src/connector.rs b/crates/router/src/connector.rs index 1f67c1f75d76..1b62748f15b5 100644 --- a/crates/router/src/connector.rs +++ b/crates/router/src/connector.rs @@ -53,7 +53,8 @@ pub use hyperswitch_connectors::connectors::{ payu::Payu, powertranz, powertranz::Powertranz, prophetpay, prophetpay::Prophetpay, rapyd, rapyd::Rapyd, razorpay, razorpay::Razorpay, redsys, redsys::Redsys, shift4, shift4::Shift4, square, square::Square, stax, stax::Stax, taxjar, taxjar::Taxjar, thunes, thunes::Thunes, tsys, - tsys::Tsys, volt, volt::Volt, worldline, worldline::Worldline, worldpay, worldpay::Worldpay, + tsys::Tsys, unifiedauthenticationservice, + unifiedauthenticationservice::Unifiedauthenticationservice, volt, volt::Volt, worldline, worldline::Worldline, worldpay, worldpay::Worldpay, xendit, xendit::Xendit, zen, zen::Zen, zsl, zsl::Zsl, }; diff --git a/crates/router/src/core/payments/connector_integration_v2_impls.rs b/crates/router/src/core/payments/connector_integration_v2_impls.rs index 7aeca55592a1..36658f573cbc 100644 --- a/crates/router/src/core/payments/connector_integration_v2_impls.rs +++ b/crates/router/src/core/payments/connector_integration_v2_impls.rs @@ -1145,6 +1145,7 @@ default_imp_for_new_connector_integration_payouts!( connector::Threedsecureio, connector::Thunes, connector::Tsys, + connector::Unifiedauthenticationservice, connector::Volt, connector::Wellsfargo, connector::Wise, @@ -1747,6 +1748,7 @@ default_imp_for_new_connector_integration_frm!( connector::Threedsecureio, connector::Thunes, connector::Tsys, + connector::Unifiedauthenticationservice, connector::Volt, connector::Wellsfargo, connector::Wise, @@ -2214,6 +2216,7 @@ default_imp_for_new_connector_integration_connector_authentication!( connector::Threedsecureio, connector::Thunes, connector::Tsys, + connector::Unifiedauthenticationservice, connector::Volt, connector::Wellsfargo, connector::Wise, diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs index 45fe296e8edb..5d4db31180c3 100644 --- a/crates/router/src/core/payments/flows.rs +++ b/crates/router/src/core/payments/flows.rs @@ -504,6 +504,7 @@ default_imp_for_connector_request_id!( connector::Threedsecureio, connector::Trustpay, connector::Tsys, + connector::Unifiedauthenticationservice, connector::Volt, connector::Wellsfargo, connector::Wellsfargopayout, @@ -1707,6 +1708,7 @@ default_imp_for_fraud_check!( connector::Threedsecureio, connector::Trustpay, connector::Tsys, + connector::Unifiedauthenticationservice, connector::Volt, connector::Wellsfargo, connector::Wellsfargopayout, @@ -2337,6 +2339,7 @@ default_imp_for_connector_authentication!( connector::Taxjar, connector::Trustpay, connector::Tsys, + connector::Unifiedauthenticationservice, connector::Volt, connector::Wellsfargo, connector::Wellsfargopayout, diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs index 975b219a26ca..83ec0ce7c2c3 100644 --- a/crates/router/src/types/api.rs +++ b/crates/router/src/types/api.rs @@ -528,7 +528,9 @@ impl ConnectorData { Ok(ConnectorEnum::Old(Box::new(connector::Trustpay::new()))) } enums::Connector::Tsys => Ok(ConnectorEnum::Old(Box::new(connector::Tsys::new()))), - + // enums::Connector::Unifiedauthenticationservice => Ok(ConnectorEnum::Old(Box::new( + // connector::Unifiedauthenticationservice, + // ))), enums::Connector::Volt => Ok(ConnectorEnum::Old(Box::new(connector::Volt::new()))), enums::Connector::Wellsfargo => { Ok(ConnectorEnum::Old(Box::new(connector::Wellsfargo::new()))) diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs index 55a523b528eb..717888a9dc74 100644 --- a/crates/router/src/types/transformers.rs +++ b/crates/router/src/types/transformers.rs @@ -299,6 +299,9 @@ impl ForeignTryFrom for common_enums::RoutableConnectors { // api_enums::Connector::Thunes => Self::Thunes, api_enums::Connector::Trustpay => Self::Trustpay, api_enums::Connector::Tsys => Self::Tsys, + // api_enums::Connector::Unifiedauthenticationservice => { + // Self::Unifiedauthenticationservice + // } api_enums::Connector::Volt => Self::Volt, api_enums::Connector::Wellsfargo => Self::Wellsfargo, // api_enums::Connector::Wellsfargopayout => Self::Wellsfargopayout, diff --git a/crates/router/tests/connectors/main.rs b/crates/router/tests/connectors/main.rs index dcedb171675a..4939929b3cdf 100644 --- a/crates/router/tests/connectors/main.rs +++ b/crates/router/tests/connectors/main.rs @@ -82,6 +82,7 @@ mod stripe; mod taxjar; mod trustpay; mod tsys; +mod unifiedauthenticationservice; mod utils; mod volt; mod wellsfargo; diff --git a/crates/router/tests/connectors/sample_auth.toml b/crates/router/tests/connectors/sample_auth.toml index d099c16254b0..586d24dea779 100644 --- a/crates/router/tests/connectors/sample_auth.toml +++ b/crates/router/tests/connectors/sample_auth.toml @@ -300,4 +300,7 @@ api_key="API Key" api_key="API Key" [nomupay] +api_key="API Key" + +[unifiedauthenticationservice] api_key="API Key" \ No newline at end of file diff --git a/crates/router/tests/connectors/unifiedauthenticationservice.rs b/crates/router/tests/connectors/unifiedauthenticationservice.rs new file mode 100644 index 000000000000..bf09864c5050 --- /dev/null +++ b/crates/router/tests/connectors/unifiedauthenticationservice.rs @@ -0,0 +1,421 @@ +use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData}; +use masking::Secret; +use router::types::{self, api, storage::enums}; +use test_utils::connector_auth; + +use crate::utils::{self, ConnectorActions}; + +#[derive(Clone, Copy)] +struct UnifiedauthenticationserviceTest; +impl ConnectorActions for UnifiedauthenticationserviceTest {} +impl utils::Connector for UnifiedauthenticationserviceTest { + fn get_data(&self) -> api::ConnectorData { + use router::connector::Unifiedauthenticationservice; + utils::construct_connector_data_old( + Box::new(Unifiedauthenticationservice::new()), + types::Connector::Plaid, + api::GetToken::Connector, + None, + ) + } + + fn get_auth_token(&self) -> types::ConnectorAuthType { + utils::to_connector_auth_type( + connector_auth::ConnectorAuthentication::new() + .unifiedauthenticationservice + .expect("Missing connector authentication configuration") + .into(), + ) + } + + fn get_name(&self) -> String { + "unifiedauthenticationservice".to_string() + } +} + +static CONNECTOR: UnifiedauthenticationserviceTest = UnifiedauthenticationserviceTest {}; + +fn get_default_payment_info() -> Option { + None +} + +fn payment_method_details() -> Option { + None +} + +// Cards Positive Tests +// Creates a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_only_authorize_payment() { + let response = CONNECTOR + .authorize_payment(payment_method_details(), get_default_payment_info()) + .await + .expect("Authorize payment response"); + assert_eq!(response.status, enums::AttemptStatus::Authorized); +} + +// Captures a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_capture_authorized_payment() { + let response = CONNECTOR + .authorize_and_capture_payment(payment_method_details(), None, get_default_payment_info()) + .await + .expect("Capture payment response"); + assert_eq!(response.status, enums::AttemptStatus::Charged); +} + +// Partially captures a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_capture_authorized_payment() { + let response = CONNECTOR + .authorize_and_capture_payment( + payment_method_details(), + Some(types::PaymentsCaptureData { + amount_to_capture: 50, + ..utils::PaymentCaptureType::default().0 + }), + get_default_payment_info(), + ) + .await + .expect("Capture payment response"); + assert_eq!(response.status, enums::AttemptStatus::Charged); +} + +// Synchronizes a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_authorized_payment() { + let authorize_response = CONNECTOR + .authorize_payment(payment_method_details(), get_default_payment_info()) + .await + .expect("Authorize payment response"); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + let response = CONNECTOR + .psync_retry_till_status_matches( + enums::AttemptStatus::Authorized, + Some(types::PaymentsSyncData { + connector_transaction_id: types::ResponseId::ConnectorTransactionId( + txn_id.unwrap(), + ), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .expect("PSync response"); + assert_eq!(response.status, enums::AttemptStatus::Authorized,); +} + +// Voids a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_void_authorized_payment() { + let response = CONNECTOR + .authorize_and_void_payment( + payment_method_details(), + Some(types::PaymentsCancelData { + connector_transaction_id: String::from(""), + cancellation_reason: Some("requested_by_customer".to_string()), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .expect("Void payment response"); + assert_eq!(response.status, enums::AttemptStatus::Voided); +} + +// Refunds a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_manually_captured_payment() { + let response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Partially refunds a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_refund_manually_captured_payment() { + let response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Synchronizes a refund using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_manually_captured_refund() { + let refund_response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + let response = CONNECTOR + .rsync_retry_till_status_matches( + enums::RefundStatus::Success, + refund_response.response.unwrap().connector_refund_id, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Creates a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_make_payment() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); +} + +// Synchronizes a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_auto_captured_payment() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + assert_ne!(txn_id, None, "Empty connector transaction id"); + let response = CONNECTOR + .psync_retry_till_status_matches( + enums::AttemptStatus::Charged, + Some(types::PaymentsSyncData { + connector_transaction_id: types::ResponseId::ConnectorTransactionId( + txn_id.unwrap(), + ), + capture_method: Some(enums::CaptureMethod::Automatic), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!(response.status, enums::AttemptStatus::Charged,); +} + +// Refunds a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_auto_captured_payment() { + let response = CONNECTOR + .make_payment_and_refund(payment_method_details(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Partially refunds a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_refund_succeeded_payment() { + let refund_response = CONNECTOR + .make_payment_and_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + refund_response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Creates multiple refunds against a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_succeeded_payment_multiple_times() { + CONNECTOR + .make_payment_and_multiple_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await; +} + +// Synchronizes a refund using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_refund() { + let refund_response = CONNECTOR + .make_payment_and_refund(payment_method_details(), None, get_default_payment_info()) + .await + .unwrap(); + let response = CONNECTOR + .rsync_retry_till_status_matches( + enums::RefundStatus::Success, + refund_response.response.unwrap().connector_refund_id, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Cards Negative scenarios +// Creates a payment with incorrect CVC. +#[actix_web::test] +async fn should_fail_payment_for_incorrect_cvc() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: PaymentMethodData::Card(Card { + card_cvc: Secret::new("12345".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's security code is invalid.".to_string(), + ); +} + +// Creates a payment with incorrect expiry month. +#[actix_web::test] +async fn should_fail_payment_for_invalid_exp_month() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: PaymentMethodData::Card(Card { + card_exp_month: Secret::new("20".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's expiration month is invalid.".to_string(), + ); +} + +// Creates a payment with incorrect expiry year. +#[actix_web::test] +async fn should_fail_payment_for_incorrect_expiry_year() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: PaymentMethodData::Card(Card { + card_exp_year: Secret::new("2000".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's expiration year is invalid.".to_string(), + ); +} + +// Voids a payment using automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_fail_void_payment_for_auto_capture() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + assert_ne!(txn_id, None, "Empty connector transaction id"); + let void_response = CONNECTOR + .void_payment(txn_id.unwrap(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + void_response.response.unwrap_err().message, + "You cannot cancel this PaymentIntent because it has a status of succeeded." + ); +} + +// Captures a payment using invalid connector payment id. +#[actix_web::test] +async fn should_fail_capture_for_invalid_payment() { + let capture_response = CONNECTOR + .capture_payment("123456789".to_string(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + capture_response.response.unwrap_err().message, + String::from("No such payment_intent: '123456789'") + ); +} + +// Refunds a payment with refund amount higher than payment amount. +#[actix_web::test] +async fn should_fail_for_refund_amount_higher_than_payment_amount() { + let response = CONNECTOR + .make_payment_and_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 150, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Refund amount (₹1.50) is greater than charge amount (₹1.00)", + ); +} + +// Connector dependent test cases goes here + +// [#478]: add unit tests for non 3DS, wallets & webhooks in connector tests diff --git a/crates/test_utils/src/connector_auth.rs b/crates/test_utils/src/connector_auth.rs index 3fab02e64d19..13a0ab487563 100644 --- a/crates/test_utils/src/connector_auth.rs +++ b/crates/test_utils/src/connector_auth.rs @@ -89,6 +89,7 @@ pub struct ConnectorAuthentication { pub stripe_uk: Option, pub trustpay: Option, pub tsys: Option, + pub unifiedauthenticationservice: Option, pub volt: Option, pub wellsfargo: Option, // pub wellsfargopayout: Option, diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml index 81bcf01fddc1..06488656f04f 100644 --- a/loadtest/config/development.toml +++ b/loadtest/config/development.toml @@ -164,6 +164,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" +unifiedauthenticationservice.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" @@ -252,6 +253,7 @@ cards = [ "thunes", "trustpay", "tsys", + "unifiedauthenticationservice", "volt", "wellsfargo", "wellsfargopayout", diff --git a/scripts/add_connector.sh b/scripts/add_connector.sh index fd555a416135..60d5c7b366d6 100755 --- a/scripts/add_connector.sh +++ b/scripts/add_connector.sh @@ -6,7 +6,7 @@ function find_prev_connector() { git checkout $self cp $self $self.tmp # Add new connector to existing list and sort it - connectors=(aci adyen adyenplatform airwallex amazonpay applepay authorizedotnet bambora bamboraapac bankofamerica billwerk bitpay bluesnap boku braintree cashtocode checkout coinbase cryptopay cybersource datatrans deutschebank digitalvirgo dlocal dummyconnector ebanx elavon fiserv fiservemea fiuu forte globalpay globepay gocardless gpayments helcim iatapay inespay itaubank jpmorgan klarna mifinity mollie multisafepay netcetera nexinets nexixpay nomupay noon novalnet nuvei opayo opennode paybox payeezy payme payone paypal payu placetopay plaid powertranz prophetpay rapyd razorpay redsys shift4 square stax stripe taxjar threedsecureio thunes trustpay tsys volt wellsfargo wellsfargopayout wise worldline worldpay xendit zsl "$1") + connectors=(aci adyen adyenplatform airwallex amazonpay applepay authorizedotnet bambora bamboraapac bankofamerica billwerk bitpay bluesnap boku braintree cashtocode checkout coinbase cryptopay cybersource datatrans deutschebank digitalvirgo dlocal dummyconnector ebanx elavon fiserv fiservemea fiuu forte globalpay globepay gocardless gpayments helcim iatapay inespay itaubank jpmorgan klarna mifinity mollie multisafepay netcetera nexinets nexixpay nomupay noon novalnet nuvei opayo opennode paybox payeezy payme payone paypal payu placetopay plaid powertranz prophetpay rapyd razorpay redsys shift4 square stax stripe taxjar threedsecureio thunes trustpay tsys unifiedauthenticationservice volt wellsfargo wellsfargopayout wise worldline worldpay xendit zsl "$1") IFS=$'\n' sorted=($(sort <<<"${connectors[*]}")); unset IFS res="$(echo ${sorted[@]})" sed -i'' -e "s/^ connectors=.*/ connectors=($res \"\$1\")/" $self.tmp From 87f6133c7c7b1153dc99ffa32ed3bb11a6bddd70 Mon Sep 17 00:00:00 2001 From: sumanmaji4 Date: Wed, 4 Dec 2024 13:44:19 +0530 Subject: [PATCH 2/3] comment resolved --- config/config.example.toml | 2 +- config/deployments/integration_test.toml | 2 +- config/deployments/production.toml | 2 +- config/deployments/sandbox.toml | 2 +- config/development.toml | 4 +- config/docker_compose.toml | 4 +- crates/api_models/src/connector_enums.rs | 4 +- crates/common_enums/src/connector_enums.rs | 2 +- .../hyperswitch_connectors/src/connectors.rs | 4 +- ...e.rs => unified_authentication_service.rs} | 105 +++++++++--------- .../transformers.rs | 52 ++++----- .../src/default_implementations.rs | 64 +++++------ .../src/default_implementations_v2.rs | 44 ++++---- crates/hyperswitch_interfaces/src/configs.rs | 2 +- crates/router/src/connector.rs | 4 +- .../connector_integration_v2_impls.rs | 6 +- crates/router/src/core/payments/flows.rs | 6 +- crates/router/src/types/api.rs | 4 +- crates/router/src/types/transformers.rs | 4 +- crates/router/tests/connectors/main.rs | 2 +- .../router/tests/connectors/sample_auth.toml | 2 +- ...e.rs => unified_authentication_service.rs} | 16 +-- crates/test_utils/src/connector_auth.rs | 2 +- loadtest/config/development.toml | 4 +- scripts/add_connector.sh | 2 +- 25 files changed, 173 insertions(+), 172 deletions(-) rename crates/hyperswitch_connectors/src/connectors/{unifiedauthenticationservice.rs => unified_authentication_service.rs} (84%) rename crates/hyperswitch_connectors/src/connectors/{unifiedauthenticationservice => unified_authentication_service}/transformers.rs (81%) rename crates/router/tests/connectors/{unifiedauthenticationservice.rs => unified_authentication_service.rs} (96%) diff --git a/config/config.example.toml b/config/config.example.toml index 81bf31a1827e..5aa9e543fb22 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -267,7 +267,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" -unifiedauthenticationservice.base_url = "http://localhost:8000" +unified_authentication_service.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml index ba14092e6825..de8063b10294 100644 --- a/config/deployments/integration_test.toml +++ b/config/deployments/integration_test.toml @@ -107,7 +107,7 @@ thunes.base_url = "https://api.limonetikqualif.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" -unifiedauthenticationservice.base_url = "http://localhost:8000" +unified_authentication_service.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" diff --git a/config/deployments/production.toml b/config/deployments/production.toml index 6ae91f579058..82f9b65b27a7 100644 --- a/config/deployments/production.toml +++ b/config/deployments/production.toml @@ -111,7 +111,7 @@ thunes.base_url = "https://api.limonetik.com/" trustpay.base_url = "https://tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://gateway.transit-pass.com/" -unifiedauthenticationservice.base_url = "http://localhost:8000" +unified_authentication_service.base_url = "http://localhost:8000" volt.base_url = "https://api.volt.io/" wellsfargo.base_url = "https://api.cybersource.com/" wellsfargopayout.base_url = "https://api.wellsfargo.com/" diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index cfed74a20077..accf2f586afe 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -111,7 +111,7 @@ thunes.base_url = "https://api.limonetikqualif.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" -unifiedauthenticationservice.base_url = "http://localhost:8000" +unified_authentication_service.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" diff --git a/config/development.toml b/config/development.toml index d41a93b12ff4..fa577a78e6ad 100644 --- a/config/development.toml +++ b/config/development.toml @@ -165,7 +165,7 @@ cards = [ "thunes", "trustpay", "tsys", - "unifiedauthenticationservice", + "unified_authentication_service", "volt", "wellsfargo", "wellsfargopayout", @@ -288,7 +288,7 @@ worldpay.base_url = "https://try.access.worldpay.com/" xendit.base_url = "https://api.xendit.co" trustpay.base_url = "https://test-tpgw.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" -unifiedauthenticationservice.base_url = "http://localhost:8000" +unified_authentication_service.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" diff --git a/config/docker_compose.toml b/config/docker_compose.toml index 64bb951840c5..3cc690203e68 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -198,7 +198,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" -unifiedauthenticationservice.base_url = "http://localhost:8000" +unified_authentication_service.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" @@ -288,7 +288,7 @@ cards = [ "thunes", "trustpay", "tsys", - "unifiedauthenticationservice", + "unified_authentication_service", "volt", "wellsfargo", "wellsfargopayout", diff --git a/crates/api_models/src/connector_enums.rs b/crates/api_models/src/connector_enums.rs index 6557841f11ce..9617e6450f4c 100644 --- a/crates/api_models/src/connector_enums.rs +++ b/crates/api_models/src/connector_enums.rs @@ -123,7 +123,7 @@ pub enum Connector { //Thunes, Trustpay, Tsys, - // Unifiedauthenticationservice, + // UnifiedAuthenticationService, Volt, Wellsfargo, // Wellsfargopayout, @@ -261,7 +261,7 @@ impl Connector { // | Self::Thunes | Self::Trustpay | Self::Tsys - // | Self::Unifiedauthenticationservice + // | Self::UnifiedAuthenticationService | Self::Volt | Self::Wellsfargo // | Self::Wellsfargopayout diff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rs index 1b656e86376a..1776ade36661 100644 --- a/crates/common_enums/src/connector_enums.rs +++ b/crates/common_enums/src/connector_enums.rs @@ -120,7 +120,7 @@ pub enum RoutableConnectors { // Thunes // Tsys, Tsys, - // Unifiedauthenticationservice, + // UnifiedAuthenticationService, Volt, Wellsfargo, // Wellsfargopayout, diff --git a/crates/hyperswitch_connectors/src/connectors.rs b/crates/hyperswitch_connectors/src/connectors.rs index cc4ac6703376..e7ea31ee0e0b 100644 --- a/crates/hyperswitch_connectors/src/connectors.rs +++ b/crates/hyperswitch_connectors/src/connectors.rs @@ -40,7 +40,7 @@ pub mod stax; pub mod taxjar; pub mod thunes; pub mod tsys; -pub mod unifiedauthenticationservice; +pub mod unified_authentication_service; pub mod volt; pub mod worldline; pub mod worldpay; @@ -58,6 +58,6 @@ pub use self::{ nexixpay::Nexixpay, nomupay::Nomupay, novalnet::Novalnet, payeezy::Payeezy, payu::Payu, powertranz::Powertranz, prophetpay::Prophetpay, rapyd::Rapyd, razorpay::Razorpay, redsys::Redsys, shift4::Shift4, square::Square, stax::Stax, taxjar::Taxjar, thunes::Thunes, - tsys::Tsys, unifiedauthenticationservice::Unifiedauthenticationservice, volt::Volt, + tsys::Tsys, unified_authentication_service::UnifiedAuthenticationService, volt::Volt, worldline::Worldline, worldpay::Worldpay, xendit::Xendit, zen::Zen, zsl::Zsl, }; diff --git a/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice.rs b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs similarity index 84% rename from crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice.rs rename to crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs index e00deb07222f..e85fe5dd7de7 100644 --- a/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice.rs +++ b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs @@ -34,16 +34,16 @@ use hyperswitch_interfaces::{ webhooks, }; use masking::{ExposeInterface, Mask}; -use transformers as unifiedauthenticationservice; +use transformers as unified_authentication_service; use crate::{constants::headers, types::ResponseRouterData, utils}; #[derive(Clone)] -pub struct Unifiedauthenticationservice { +pub struct UnifiedAuthenticationService { amount_converter: &'static (dyn AmountConvertor + Sync), } -impl Unifiedauthenticationservice { +impl UnifiedAuthenticationService { pub fn new() -> &'static Self { &Self { amount_converter: &StringMinorUnitForConnector, @@ -51,27 +51,27 @@ impl Unifiedauthenticationservice { } } -impl api::Payment for Unifiedauthenticationservice {} -impl api::PaymentSession for Unifiedauthenticationservice {} -impl api::ConnectorAccessToken for Unifiedauthenticationservice {} -impl api::MandateSetup for Unifiedauthenticationservice {} -impl api::PaymentAuthorize for Unifiedauthenticationservice {} -impl api::PaymentSync for Unifiedauthenticationservice {} -impl api::PaymentCapture for Unifiedauthenticationservice {} -impl api::PaymentVoid for Unifiedauthenticationservice {} -impl api::Refund for Unifiedauthenticationservice {} -impl api::RefundExecute for Unifiedauthenticationservice {} -impl api::RefundSync for Unifiedauthenticationservice {} -impl api::PaymentToken for Unifiedauthenticationservice {} +impl api::Payment for UnifiedAuthenticationService {} +impl api::PaymentSession for UnifiedAuthenticationService {} +impl api::ConnectorAccessToken for UnifiedAuthenticationService {} +impl api::MandateSetup for UnifiedAuthenticationService {} +impl api::PaymentAuthorize for UnifiedAuthenticationService {} +impl api::PaymentSync for UnifiedAuthenticationService {} +impl api::PaymentCapture for UnifiedAuthenticationService {} +impl api::PaymentVoid for UnifiedAuthenticationService {} +impl api::Refund for UnifiedAuthenticationService {} +impl api::RefundExecute for UnifiedAuthenticationService {} +impl api::RefundSync for UnifiedAuthenticationService {} +impl api::PaymentToken for UnifiedAuthenticationService {} impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { // Not Implemented (R) } impl ConnectorCommonExt - for Unifiedauthenticationservice + for UnifiedAuthenticationService where Self: ConnectorIntegration, { @@ -90,9 +90,9 @@ where } } -impl ConnectorCommon for Unifiedauthenticationservice { +impl ConnectorCommon for UnifiedAuthenticationService { fn id(&self) -> &'static str { - "unifiedauthenticationservice" + "unified_authentication_service" } fn get_currency_unit(&self) -> api::CurrencyUnit { @@ -107,16 +107,17 @@ impl ConnectorCommon for Unifiedauthenticationservice { } fn base_url<'a>(&self, connectors: &'a Connectors) -> &'a str { - connectors.unifiedauthenticationservice.base_url.as_ref() + connectors.unified_authentication_service.base_url.as_ref() } fn get_auth_header( &self, auth_type: &ConnectorAuthType, ) -> CustomResult)>, errors::ConnectorError> { - let auth = - unifiedauthenticationservice::UnifiedauthenticationserviceAuthType::try_from(auth_type) - .change_context(errors::ConnectorError::FailedToObtainAuthType)?; + let auth = unified_authentication_service::UnifiedAuthenticationServiceAuthType::try_from( + auth_type, + ) + .change_context(errors::ConnectorError::FailedToObtainAuthType)?; Ok(vec![( headers::AUTHORIZATION.to_string(), auth.api_key.expose().into_masked(), @@ -128,10 +129,10 @@ impl ConnectorCommon for Unifiedauthenticationservice { res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult { - let response: unifiedauthenticationservice::UnifiedauthenticationserviceErrorResponse = res - .response - .parse_struct("UnifiedauthenticationserviceErrorResponse") - .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + let response: unified_authentication_service::UnifiedAuthenticationServiceErrorResponse = + res.response + .parse_struct("UnifiedAuthenticationServiceErrorResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); @@ -147,28 +148,28 @@ impl ConnectorCommon for Unifiedauthenticationservice { } } -impl ConnectorValidation for Unifiedauthenticationservice { +impl ConnectorValidation for UnifiedAuthenticationService { //TODO: implement functions when support enabled } impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { //TODO: implement sessions flow } impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { } impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { } impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { fn get_headers( &self, @@ -202,11 +203,11 @@ impl ConnectorIntegration, res: Response, ) -> CustomResult { - let response: unifiedauthenticationservice::UnifiedauthenticationservicePaymentsResponse = + let response: unified_authentication_service::UnifiedAuthenticationServicePaymentsResponse = res.response - .parse_struct("Unifiedauthenticationservice PaymentsAuthorizeResponse") + .parse_struct("UnifiedAuthenticationService PaymentsAuthorizeResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); @@ -263,7 +264,7 @@ impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { fn get_headers( &self, @@ -306,9 +307,9 @@ impl ConnectorIntegration event_builder: Option<&mut ConnectorEvent>, res: Response, ) -> CustomResult { - let response: unifiedauthenticationservice::UnifiedauthenticationservicePaymentsResponse = + let response: unified_authentication_service::UnifiedAuthenticationServicePaymentsResponse = res.response - .parse_struct("unifiedauthenticationservice PaymentsSyncResponse") + .parse_struct("unified_authentication_service PaymentsSyncResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); @@ -329,7 +330,7 @@ impl ConnectorIntegration } impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { fn get_headers( &self, @@ -385,9 +386,9 @@ impl ConnectorIntegration event_builder: Option<&mut ConnectorEvent>, res: Response, ) -> CustomResult { - let response: unifiedauthenticationservice::UnifiedauthenticationservicePaymentsResponse = + let response: unified_authentication_service::UnifiedAuthenticationServicePaymentsResponse = res.response - .parse_struct("Unifiedauthenticationservice PaymentsCaptureResponse") + .parse_struct("UnifiedAuthenticationService PaymentsCaptureResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); @@ -408,12 +409,12 @@ impl ConnectorIntegration } impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { } impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { fn get_headers( &self, @@ -447,12 +448,12 @@ impl ConnectorIntegration )?; let connector_router_data = - unifiedauthenticationservice::UnifiedauthenticationserviceRouterData::from(( + unified_authentication_service::UnifiedAuthenticationServiceRouterData::from(( refund_amount, req, )); let connector_req = - unifiedauthenticationservice::UnifiedauthenticationserviceRefundRequest::try_from( + unified_authentication_service::UnifiedAuthenticationServiceRefundRequest::try_from( &connector_router_data, )?; Ok(RequestContent::Json(Box::new(connector_req))) @@ -483,9 +484,9 @@ impl ConnectorIntegration event_builder: Option<&mut ConnectorEvent>, res: Response, ) -> CustomResult, errors::ConnectorError> { - let response: unifiedauthenticationservice::RefundResponse = res + let response: unified_authentication_service::RefundResponse = res .response - .parse_struct("unifiedauthenticationservice RefundResponse") + .parse_struct("UnifiedAuthenticationService RefundResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); @@ -506,7 +507,7 @@ impl ConnectorIntegration } impl ConnectorIntegration - for Unifiedauthenticationservice + for UnifiedAuthenticationService { fn get_headers( &self, @@ -552,9 +553,9 @@ impl ConnectorIntegration event_builder: Option<&mut ConnectorEvent>, res: Response, ) -> CustomResult { - let response: unifiedauthenticationservice::RefundResponse = res + let response: unified_authentication_service::RefundResponse = res .response - .parse_struct("unifiedauthenticationservice RefundSyncResponse") + .parse_struct("UnifiedAuthenticationService RefundSyncResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); @@ -575,7 +576,7 @@ impl ConnectorIntegration } #[async_trait::async_trait] -impl webhooks::IncomingWebhook for Unifiedauthenticationservice { +impl webhooks::IncomingWebhook for UnifiedAuthenticationService { fn get_webhook_object_reference_id( &self, _request: &webhooks::IncomingWebhookRequestDetails<'_>, diff --git a/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice/transformers.rs b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs similarity index 81% rename from crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice/transformers.rs rename to crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs index 2cd139082402..6a9347dbeed7 100644 --- a/crates/hyperswitch_connectors/src/connectors/unifiedauthenticationservice/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs @@ -18,12 +18,12 @@ use crate::{ }; //TODO: Fill the struct with respective fields -pub struct UnifiedauthenticationserviceRouterData { +pub struct UnifiedAuthenticationServiceRouterData { pub amount: StringMinorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc. pub router_data: T, } -impl From<(StringMinorUnit, T)> for UnifiedauthenticationserviceRouterData { +impl From<(StringMinorUnit, T)> for UnifiedAuthenticationServiceRouterData { fn from((amount, item): (StringMinorUnit, T)) -> Self { //Todo : use utils to convert the amount to the type of amount that a connector accepts Self { @@ -35,13 +35,13 @@ impl From<(StringMinorUnit, T)> for UnifiedauthenticationserviceRouterData //TODO: Fill the struct with respective fields #[derive(Default, Debug, Serialize, PartialEq)] -pub struct UnifiedauthenticationservicePaymentsRequest { +pub struct UnifiedAuthenticationServicePaymentsRequest { amount: StringMinorUnit, - card: UnifiedauthenticationserviceCard, + card: UnifiedAuthenticationServiceCard, } #[derive(Default, Debug, Serialize, Eq, PartialEq)] -pub struct UnifiedauthenticationserviceCard { +pub struct UnifiedAuthenticationServiceCard { number: cards::CardNumber, expiry_month: Secret, expiry_year: Secret, @@ -49,16 +49,16 @@ pub struct UnifiedauthenticationserviceCard { complete: bool, } -impl TryFrom<&UnifiedauthenticationserviceRouterData<&PaymentsAuthorizeRouterData>> - for UnifiedauthenticationservicePaymentsRequest +impl TryFrom<&UnifiedAuthenticationServiceRouterData<&PaymentsAuthorizeRouterData>> + for UnifiedAuthenticationServicePaymentsRequest { type Error = error_stack::Report; fn try_from( - item: &UnifiedauthenticationserviceRouterData<&PaymentsAuthorizeRouterData>, + item: &UnifiedAuthenticationServiceRouterData<&PaymentsAuthorizeRouterData>, ) -> Result { match item.router_data.request.payment_method_data.clone() { PaymentMethodData::Card(req_card) => { - let card = UnifiedauthenticationserviceCard { + let card = UnifiedAuthenticationServiceCard { number: req_card.card_number, expiry_month: req_card.card_exp_month, expiry_year: req_card.card_exp_year, @@ -77,11 +77,11 @@ impl TryFrom<&UnifiedauthenticationserviceRouterData<&PaymentsAuthorizeRouterDat //TODO: Fill the struct with respective fields // Auth Struct -pub struct UnifiedauthenticationserviceAuthType { +pub struct UnifiedAuthenticationServiceAuthType { pub(super) api_key: Secret, } -impl TryFrom<&ConnectorAuthType> for UnifiedauthenticationserviceAuthType { +impl TryFrom<&ConnectorAuthType> for UnifiedAuthenticationServiceAuthType { type Error = error_stack::Report; fn try_from(auth_type: &ConnectorAuthType) -> Result { match auth_type { @@ -96,27 +96,27 @@ impl TryFrom<&ConnectorAuthType> for UnifiedauthenticationserviceAuthType { //TODO: Append the remaining status flags #[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "lowercase")] -pub enum UnifiedauthenticationservicePaymentStatus { +pub enum UnifiedAuthenticationServicePaymentStatus { Succeeded, Failed, #[default] Processing, } -impl From for common_enums::AttemptStatus { - fn from(item: UnifiedauthenticationservicePaymentStatus) -> Self { +impl From for common_enums::AttemptStatus { + fn from(item: UnifiedAuthenticationServicePaymentStatus) -> Self { match item { - UnifiedauthenticationservicePaymentStatus::Succeeded => Self::Charged, - UnifiedauthenticationservicePaymentStatus::Failed => Self::Failure, - UnifiedauthenticationservicePaymentStatus::Processing => Self::Authorizing, + UnifiedAuthenticationServicePaymentStatus::Succeeded => Self::Charged, + UnifiedAuthenticationServicePaymentStatus::Failed => Self::Failure, + UnifiedAuthenticationServicePaymentStatus::Processing => Self::Authorizing, } } } //TODO: Fill the struct with respective fields #[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)] -pub struct UnifiedauthenticationservicePaymentsResponse { - status: UnifiedauthenticationservicePaymentStatus, +pub struct UnifiedAuthenticationServicePaymentsResponse { + status: UnifiedAuthenticationServicePaymentStatus, id: String, } @@ -124,7 +124,7 @@ impl TryFrom< ResponseRouterData< F, - UnifiedauthenticationservicePaymentsResponse, + UnifiedAuthenticationServicePaymentsResponse, T, PaymentsResponseData, >, @@ -134,7 +134,7 @@ impl fn try_from( item: ResponseRouterData< F, - UnifiedauthenticationservicePaymentsResponse, + UnifiedAuthenticationServicePaymentsResponse, T, PaymentsResponseData, >, @@ -160,16 +160,16 @@ impl // REFUND : // Type definition for RefundRequest #[derive(Default, Debug, Serialize)] -pub struct UnifiedauthenticationserviceRefundRequest { +pub struct UnifiedAuthenticationServiceRefundRequest { pub amount: StringMinorUnit, } -impl TryFrom<&UnifiedauthenticationserviceRouterData<&RefundsRouterData>> - for UnifiedauthenticationserviceRefundRequest +impl TryFrom<&UnifiedAuthenticationServiceRouterData<&RefundsRouterData>> + for UnifiedAuthenticationServiceRefundRequest { type Error = error_stack::Report; fn try_from( - item: &UnifiedauthenticationserviceRouterData<&RefundsRouterData>, + item: &UnifiedAuthenticationServiceRouterData<&RefundsRouterData>, ) -> Result { Ok(Self { amount: item.amount.to_owned(), @@ -238,7 +238,7 @@ impl TryFrom> for RefundsRouter //TODO: Fill the struct with respective fields #[derive(Default, Debug, Serialize, Deserialize, PartialEq)] -pub struct UnifiedauthenticationserviceErrorResponse { +pub struct UnifiedAuthenticationServiceErrorResponse { pub status_code: u16, pub code: String, pub message: String, diff --git a/crates/hyperswitch_connectors/src/default_implementations.rs b/crates/hyperswitch_connectors/src/default_implementations.rs index d2baa0af9763..aaaeecb50e6c 100644 --- a/crates/hyperswitch_connectors/src/default_implementations.rs +++ b/crates/hyperswitch_connectors/src/default_implementations.rs @@ -128,7 +128,7 @@ default_imp_for_authorize_session_token!( connectors::Shift4, connectors::Stax, connectors::Taxjar, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Volt, connectors::Thunes, connectors::Tsys, @@ -195,7 +195,7 @@ default_imp_for_calculate_tax!( connectors::Square, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Volt, connectors::Worldline, connectors::Worldpay, @@ -253,7 +253,7 @@ default_imp_for_session_update!( connectors::Nexixpay, connectors::Payeezy, connectors::Payu, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Fiuu, connectors::Globepay, connectors::Gocardless, @@ -329,7 +329,7 @@ default_imp_for_post_session_tokens!( connectors::Prophetpay, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Deutschebank, connectors::Volt, connectors::Zen, @@ -386,7 +386,7 @@ default_imp_for_complete_authorize!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Xendit, @@ -452,7 +452,7 @@ default_imp_for_incremental_authorization!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -517,7 +517,7 @@ default_imp_for_create_customer!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -581,7 +581,7 @@ default_imp_for_connector_redirect_response!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Xendit, @@ -642,7 +642,7 @@ default_imp_for_pre_processing_steps!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -709,7 +709,7 @@ default_imp_for_post_processing_steps!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -776,7 +776,7 @@ default_imp_for_approve!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -843,7 +843,7 @@ default_imp_for_reject!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -910,7 +910,7 @@ default_imp_for_webhook_source_verification!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -978,7 +978,7 @@ default_imp_for_accept_dispute!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1045,7 +1045,7 @@ default_imp_for_submit_evidence!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1112,7 +1112,7 @@ default_imp_for_defend_dispute!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1188,7 +1188,7 @@ default_imp_for_file_upload!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1247,7 +1247,7 @@ default_imp_for_payouts!( connectors::Stax, connectors::Taxjar, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Volt, connectors::Worldline, connectors::Worldpay, @@ -1316,7 +1316,7 @@ default_imp_for_payouts_create!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1385,7 +1385,7 @@ default_imp_for_payouts_retrieve!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1454,7 +1454,7 @@ default_imp_for_payouts_eligibility!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1523,7 +1523,7 @@ default_imp_for_payouts_fulfill!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1592,7 +1592,7 @@ default_imp_for_payouts_cancel!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1661,7 +1661,7 @@ default_imp_for_payouts_quote!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1730,7 +1730,7 @@ default_imp_for_payouts_recipient!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1799,7 +1799,7 @@ default_imp_for_payouts_recipient_account!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1868,7 +1868,7 @@ default_imp_for_frm_sale!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -1937,7 +1937,7 @@ default_imp_for_frm_checkout!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -2006,7 +2006,7 @@ default_imp_for_frm_transaction!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -2075,7 +2075,7 @@ default_imp_for_frm_fulfillment!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -2144,7 +2144,7 @@ default_imp_for_frm_record_return!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, @@ -2210,7 +2210,7 @@ default_imp_for_revoking_mandates!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Worldpay, connectors::Volt, diff --git a/crates/hyperswitch_connectors/src/default_implementations_v2.rs b/crates/hyperswitch_connectors/src/default_implementations_v2.rs index aa4c4fb6c4ee..10a5fea8c401 100644 --- a/crates/hyperswitch_connectors/src/default_implementations_v2.rs +++ b/crates/hyperswitch_connectors/src/default_implementations_v2.rs @@ -247,7 +247,7 @@ default_imp_for_new_connector_integration_payment!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -315,7 +315,7 @@ default_imp_for_new_connector_integration_refund!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -378,7 +378,7 @@ default_imp_for_new_connector_integration_connector_access_token!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -447,7 +447,7 @@ default_imp_for_new_connector_integration_accept_dispute!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -515,7 +515,7 @@ default_imp_for_new_connector_integration_submit_evidence!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -583,7 +583,7 @@ default_imp_for_new_connector_integration_defend_dispute!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -661,7 +661,7 @@ default_imp_for_new_connector_integration_file_upload!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -731,7 +731,7 @@ default_imp_for_new_connector_integration_payouts_create!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -801,7 +801,7 @@ default_imp_for_new_connector_integration_payouts_eligibility!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -871,7 +871,7 @@ default_imp_for_new_connector_integration_payouts_fulfill!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -941,7 +941,7 @@ default_imp_for_new_connector_integration_payouts_cancel!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1011,7 +1011,7 @@ default_imp_for_new_connector_integration_payouts_quote!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1081,7 +1081,7 @@ default_imp_for_new_connector_integration_payouts_recipient!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1151,7 +1151,7 @@ default_imp_for_new_connector_integration_payouts_sync!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1221,7 +1221,7 @@ default_imp_for_new_connector_integration_payouts_recipient_account!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1289,7 +1289,7 @@ default_imp_for_new_connector_integration_webhook_source_verification!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1359,7 +1359,7 @@ default_imp_for_new_connector_integration_frm_sale!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1429,7 +1429,7 @@ default_imp_for_new_connector_integration_frm_checkout!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1499,7 +1499,7 @@ default_imp_for_new_connector_integration_frm_transaction!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1569,7 +1569,7 @@ default_imp_for_new_connector_integration_frm_fulfillment!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1639,7 +1639,7 @@ default_imp_for_new_connector_integration_frm_record_return!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, @@ -1706,7 +1706,7 @@ default_imp_for_new_connector_integration_revoking_mandates!( connectors::Taxjar, connectors::Thunes, connectors::Tsys, - connectors::Unifiedauthenticationservice, + connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, diff --git a/crates/hyperswitch_interfaces/src/configs.rs b/crates/hyperswitch_interfaces/src/configs.rs index 93cf888a4158..e7e59d2d0637 100644 --- a/crates/hyperswitch_interfaces/src/configs.rs +++ b/crates/hyperswitch_interfaces/src/configs.rs @@ -88,7 +88,7 @@ pub struct Connectors { pub thunes: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub tsys: ConnectorParams, - pub unifiedauthenticationservice: ConnectorParams, + pub unified_authentication_service: ConnectorParams, pub volt: ConnectorParams, pub wellsfargo: ConnectorParams, pub wellsfargopayout: ConnectorParams, diff --git a/crates/router/src/connector.rs b/crates/router/src/connector.rs index 1b62748f15b5..4d1114d92a15 100644 --- a/crates/router/src/connector.rs +++ b/crates/router/src/connector.rs @@ -53,8 +53,8 @@ pub use hyperswitch_connectors::connectors::{ payu::Payu, powertranz, powertranz::Powertranz, prophetpay, prophetpay::Prophetpay, rapyd, rapyd::Rapyd, razorpay, razorpay::Razorpay, redsys, redsys::Redsys, shift4, shift4::Shift4, square, square::Square, stax, stax::Stax, taxjar, taxjar::Taxjar, thunes, thunes::Thunes, tsys, - tsys::Tsys, unifiedauthenticationservice, - unifiedauthenticationservice::Unifiedauthenticationservice, volt, volt::Volt, worldline, worldline::Worldline, worldpay, worldpay::Worldpay, + tsys::Tsys, unified_authentication_service, + unified_authentication_service::UnifiedAuthenticationService, volt, volt::Volt, worldline, worldline::Worldline, worldpay, worldpay::Worldpay, xendit, xendit::Xendit, zen, zen::Zen, zsl, zsl::Zsl, }; diff --git a/crates/router/src/core/payments/connector_integration_v2_impls.rs b/crates/router/src/core/payments/connector_integration_v2_impls.rs index 36658f573cbc..286680062f88 100644 --- a/crates/router/src/core/payments/connector_integration_v2_impls.rs +++ b/crates/router/src/core/payments/connector_integration_v2_impls.rs @@ -1145,7 +1145,7 @@ default_imp_for_new_connector_integration_payouts!( connector::Threedsecureio, connector::Thunes, connector::Tsys, - connector::Unifiedauthenticationservice, + connector::UnifiedAuthenticationService, connector::Volt, connector::Wellsfargo, connector::Wise, @@ -1748,7 +1748,7 @@ default_imp_for_new_connector_integration_frm!( connector::Threedsecureio, connector::Thunes, connector::Tsys, - connector::Unifiedauthenticationservice, + connector::UnifiedAuthenticationService, connector::Volt, connector::Wellsfargo, connector::Wise, @@ -2216,7 +2216,7 @@ default_imp_for_new_connector_integration_connector_authentication!( connector::Threedsecureio, connector::Thunes, connector::Tsys, - connector::Unifiedauthenticationservice, + connector::UnifiedAuthenticationService, connector::Volt, connector::Wellsfargo, connector::Wise, diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs index 5d4db31180c3..ae7a72eaed1b 100644 --- a/crates/router/src/core/payments/flows.rs +++ b/crates/router/src/core/payments/flows.rs @@ -504,7 +504,7 @@ default_imp_for_connector_request_id!( connector::Threedsecureio, connector::Trustpay, connector::Tsys, - connector::Unifiedauthenticationservice, + connector::UnifiedAuthenticationService, connector::Volt, connector::Wellsfargo, connector::Wellsfargopayout, @@ -1708,7 +1708,7 @@ default_imp_for_fraud_check!( connector::Threedsecureio, connector::Trustpay, connector::Tsys, - connector::Unifiedauthenticationservice, + connector::UnifiedAuthenticationService, connector::Volt, connector::Wellsfargo, connector::Wellsfargopayout, @@ -2339,7 +2339,7 @@ default_imp_for_connector_authentication!( connector::Taxjar, connector::Trustpay, connector::Tsys, - connector::Unifiedauthenticationservice, + connector::UnifiedAuthenticationService, connector::Volt, connector::Wellsfargo, connector::Wellsfargopayout, diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs index 83ec0ce7c2c3..cedb838d5887 100644 --- a/crates/router/src/types/api.rs +++ b/crates/router/src/types/api.rs @@ -528,8 +528,8 @@ impl ConnectorData { Ok(ConnectorEnum::Old(Box::new(connector::Trustpay::new()))) } enums::Connector::Tsys => Ok(ConnectorEnum::Old(Box::new(connector::Tsys::new()))), - // enums::Connector::Unifiedauthenticationservice => Ok(ConnectorEnum::Old(Box::new( - // connector::Unifiedauthenticationservice, + // enums::Connector::UnifiedAuthenticationService => Ok(ConnectorEnum::Old(Box::new( + // connector::UnifiedAuthenticationService, // ))), enums::Connector::Volt => Ok(ConnectorEnum::Old(Box::new(connector::Volt::new()))), enums::Connector::Wellsfargo => { diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs index 717888a9dc74..a3c3da0462a7 100644 --- a/crates/router/src/types/transformers.rs +++ b/crates/router/src/types/transformers.rs @@ -299,8 +299,8 @@ impl ForeignTryFrom for common_enums::RoutableConnectors { // api_enums::Connector::Thunes => Self::Thunes, api_enums::Connector::Trustpay => Self::Trustpay, api_enums::Connector::Tsys => Self::Tsys, - // api_enums::Connector::Unifiedauthenticationservice => { - // Self::Unifiedauthenticationservice + // api_enums::Connector::UnifiedAuthenticationService => { + // Self::UnifiedAuthenticationService // } api_enums::Connector::Volt => Self::Volt, api_enums::Connector::Wellsfargo => Self::Wellsfargo, diff --git a/crates/router/tests/connectors/main.rs b/crates/router/tests/connectors/main.rs index 4939929b3cdf..31ceb1a72456 100644 --- a/crates/router/tests/connectors/main.rs +++ b/crates/router/tests/connectors/main.rs @@ -82,7 +82,7 @@ mod stripe; mod taxjar; mod trustpay; mod tsys; -mod unifiedauthenticationservice; +mod unified_authentication_service; mod utils; mod volt; mod wellsfargo; diff --git a/crates/router/tests/connectors/sample_auth.toml b/crates/router/tests/connectors/sample_auth.toml index 586d24dea779..f2f849731d52 100644 --- a/crates/router/tests/connectors/sample_auth.toml +++ b/crates/router/tests/connectors/sample_auth.toml @@ -302,5 +302,5 @@ api_key="API Key" [nomupay] api_key="API Key" -[unifiedauthenticationservice] +[unified_authentication_service] api_key="API Key" \ No newline at end of file diff --git a/crates/router/tests/connectors/unifiedauthenticationservice.rs b/crates/router/tests/connectors/unified_authentication_service.rs similarity index 96% rename from crates/router/tests/connectors/unifiedauthenticationservice.rs rename to crates/router/tests/connectors/unified_authentication_service.rs index bf09864c5050..0a403d9d260b 100644 --- a/crates/router/tests/connectors/unifiedauthenticationservice.rs +++ b/crates/router/tests/connectors/unified_authentication_service.rs @@ -6,13 +6,13 @@ use test_utils::connector_auth; use crate::utils::{self, ConnectorActions}; #[derive(Clone, Copy)] -struct UnifiedauthenticationserviceTest; -impl ConnectorActions for UnifiedauthenticationserviceTest {} -impl utils::Connector for UnifiedauthenticationserviceTest { +struct UnifiedAuthenticationServiceTest; +impl ConnectorActions for UnifiedAuthenticationServiceTest {} +impl utils::Connector for UnifiedAuthenticationServiceTest { fn get_data(&self) -> api::ConnectorData { - use router::connector::Unifiedauthenticationservice; + use router::connector::UnifiedAuthenticationService; utils::construct_connector_data_old( - Box::new(Unifiedauthenticationservice::new()), + Box::new(UnifiedAuthenticationService::new()), types::Connector::Plaid, api::GetToken::Connector, None, @@ -22,18 +22,18 @@ impl utils::Connector for UnifiedauthenticationserviceTest { fn get_auth_token(&self) -> types::ConnectorAuthType { utils::to_connector_auth_type( connector_auth::ConnectorAuthentication::new() - .unifiedauthenticationservice + .unified_authentication_service .expect("Missing connector authentication configuration") .into(), ) } fn get_name(&self) -> String { - "unifiedauthenticationservice".to_string() + "unified_authentication_service".to_string() } } -static CONNECTOR: UnifiedauthenticationserviceTest = UnifiedauthenticationserviceTest {}; +static CONNECTOR: UnifiedAuthenticationServiceTest = UnifiedAuthenticationServiceTest {}; fn get_default_payment_info() -> Option { None diff --git a/crates/test_utils/src/connector_auth.rs b/crates/test_utils/src/connector_auth.rs index 13a0ab487563..37cc341c4540 100644 --- a/crates/test_utils/src/connector_auth.rs +++ b/crates/test_utils/src/connector_auth.rs @@ -89,7 +89,7 @@ pub struct ConnectorAuthentication { pub stripe_uk: Option, pub trustpay: Option, pub tsys: Option, - pub unifiedauthenticationservice: Option, + pub unified_authentication_service: Option, pub volt: Option, pub wellsfargo: Option, // pub wellsfargopayout: Option, diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml index 06488656f04f..51981a298e31 100644 --- a/loadtest/config/development.toml +++ b/loadtest/config/development.toml @@ -164,7 +164,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" tsys.base_url = "https://stagegw.transnox.com/" -unifiedauthenticationservice.base_url = "http://localhost:8000" +unified_authentication_service.base_url = "http://localhost:8000" volt.base_url = "https://api.sandbox.volt.io/" wellsfargo.base_url = "https://apitest.cybersource.com/" wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/" @@ -253,7 +253,7 @@ cards = [ "thunes", "trustpay", "tsys", - "unifiedauthenticationservice", + "unified_authentication_service", "volt", "wellsfargo", "wellsfargopayout", diff --git a/scripts/add_connector.sh b/scripts/add_connector.sh index 60d5c7b366d6..108e9d882635 100755 --- a/scripts/add_connector.sh +++ b/scripts/add_connector.sh @@ -6,7 +6,7 @@ function find_prev_connector() { git checkout $self cp $self $self.tmp # Add new connector to existing list and sort it - connectors=(aci adyen adyenplatform airwallex amazonpay applepay authorizedotnet bambora bamboraapac bankofamerica billwerk bitpay bluesnap boku braintree cashtocode checkout coinbase cryptopay cybersource datatrans deutschebank digitalvirgo dlocal dummyconnector ebanx elavon fiserv fiservemea fiuu forte globalpay globepay gocardless gpayments helcim iatapay inespay itaubank jpmorgan klarna mifinity mollie multisafepay netcetera nexinets nexixpay nomupay noon novalnet nuvei opayo opennode paybox payeezy payme payone paypal payu placetopay plaid powertranz prophetpay rapyd razorpay redsys shift4 square stax stripe taxjar threedsecureio thunes trustpay tsys unifiedauthenticationservice volt wellsfargo wellsfargopayout wise worldline worldpay xendit zsl "$1") + connectors=(aci adyen adyenplatform airwallex amazonpay applepay authorizedotnet bambora bamboraapac bankofamerica billwerk bitpay bluesnap boku braintree cashtocode checkout coinbase cryptopay cybersource datatrans deutschebank digitalvirgo dlocal dummyconnector ebanx elavon fiserv fiservemea fiuu forte globalpay globepay gocardless gpayments helcim iatapay inespay itaubank jpmorgan klarna mifinity mollie multisafepay netcetera nexinets nexixpay nomupay noon novalnet nuvei opayo opennode paybox payeezy payme payone paypal payu placetopay plaid powertranz prophetpay rapyd razorpay redsys shift4 square stax stripe taxjar threedsecureio thunes trustpay tsys unified_authentication_service volt wellsfargo wellsfargopayout wise worldline worldpay xendit zsl "$1") IFS=$'\n' sorted=($(sort <<<"${connectors[*]}")); unset IFS res="$(echo ${sorted[@]})" sed -i'' -e "s/^ connectors=.*/ connectors=($res \"\$1\")/" $self.tmp From 51ef649c1aca3858ddbe1157e2f78e5502470b92 Mon Sep 17 00:00:00 2001 From: "hyperswitch-bot[bot]" <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:52:40 +0000 Subject: [PATCH 3/3] chore: run formatter --- crates/router/src/connector.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/router/src/connector.rs b/crates/router/src/connector.rs index 4d1114d92a15..04e972e51871 100644 --- a/crates/router/src/connector.rs +++ b/crates/router/src/connector.rs @@ -54,8 +54,9 @@ pub use hyperswitch_connectors::connectors::{ rapyd::Rapyd, razorpay, razorpay::Razorpay, redsys, redsys::Redsys, shift4, shift4::Shift4, square, square::Square, stax, stax::Stax, taxjar, taxjar::Taxjar, thunes, thunes::Thunes, tsys, tsys::Tsys, unified_authentication_service, - unified_authentication_service::UnifiedAuthenticationService, volt, volt::Volt, worldline, worldline::Worldline, worldpay, worldpay::Worldpay, - xendit, xendit::Xendit, zen, zen::Zen, zsl, zsl::Zsl, + unified_authentication_service::UnifiedAuthenticationService, volt, volt::Volt, worldline, + worldline::Worldline, worldpay, worldpay::Worldpay, xendit, xendit::Xendit, zen, zen::Zen, zsl, + zsl::Zsl, }; #[cfg(feature = "dummy_connector")]