Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(ucs): add globalpay connector in ucs only connector list (#14092)
Shubhodip palb438fbcae02a
diff --git a/config/config.example.toml b/config/config.example.tomlindex 333248ad98..03894cd8f7 100644--- a/config/config.example.toml+++ b/config/config.example.toml@@ -1476,7 +1476,7 @@ diff_count_threshold = 100 # Non-volume routing diffs per profile within the coubase_url = "http://localhost:8000" # Unified Connector Service Base URLconnection_timeout = 10 # Connection Timeout Duration in Secondsrequest_timeout = 35 # Per-RPC Request Timeout in Seconds-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft, globalpay" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call[grpc_client.recovery_decider_client] # Revenue recovery client base urldiff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.tomlindex 312735e5de..8c8ea43d96 100644--- a/config/deployments/env_specific.toml+++ b/config/deployments/env_specific.toml@@ -472,7 +472,7 @@ payment_method = "payment_method_types" # <payment_method> = comma-separated clobase_url = "http://localhost:8000" # Unified Connector Service Base URLconnection_timeout = 10 # Connection Timeout Duration in Secondsrequest_timeout = 35 # Per-RPC Request Timeout in Seconds-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft, globalpay" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call[revenue_recovery]diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.tomlindex 333ce35ff3..1dd254e97d 100644--- a/config/deployments/integration_test.toml+++ b/config/deployments/integration_test.toml@@ -1050,7 +1050,7 @@ connector_list = "juspaythreedsserver, ctp_mastercard, ctp_visa"connector_list = "worldpayvantiv"[grpc_client.unified_connector_service]-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft, globalpay" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call# Merchant Advice Code Configurationdiff --git a/config/deployments/production.toml b/config/deployments/production.tomlindex b77da07393..9f5dfb74bf 100644--- a/config/deployments/production.toml+++ b/config/deployments/production.toml@@ -1058,7 +1058,7 @@ click_to_pay = {connector_list = "adyen, cybersource, trustpay"}connector_list = "juspaythreedsserver, ctp_mastercard, ctp_visa"[grpc_client.unified_connector_service]-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, citigate, ilixium, moneris, elavon, worldpayraft, globalpay" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call# Merchant Advice Code Configurationdiff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.tomlindex ed9b8315f6..25cc2dc4ea 100644--- a/config/deployments/sandbox.toml+++ b/config/deployments/sandbox.toml@@ -1069,7 +1069,7 @@ connector_list = "juspaythreedsserver, ctp_mastercard, ctp_visa"connector_list = "worldpayvantiv"[grpc_client.unified_connector_service]-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, citigate, ilixium, moneris, elavon, worldpayraft, globalpay" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call# Merchant Advice Code Configurationdiff --git a/config/development.toml b/config/development.tomlindex 0784564d27..65a37b2515 100644--- a/config/development.toml+++ b/config/development.toml@@ -1598,7 +1598,7 @@ enabled = "true"base_url = "http://localhost:8000"connection_timeout = 10request_timeout = 35-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft, globalpay" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call[revenue_recovery]diff --git a/crates/hyperswitch_connectors/src/connectors/globalpay.rs b/crates/hyperswitch_connectors/src/connectors/globalpay.rsindex d875553b71..fee715901e 100644--- a/crates/hyperswitch_connectors/src/connectors/globalpay.rs+++ b/crates/hyperswitch_connectors/src/connectors/globalpay.rs@@ -1238,4 +1238,19 @@ impl ConnectorSpecifications for Globalpay {fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {Some(&GLOBALPAY_SUPPORTED_WEBHOOK_FLOWS)}++ // PayPal requires an explicit POST /transactions/{id}/confirmation after the+ // payer returns from the redirect. Bank redirects (iDEAL, Giropay, EPS) are+ // auto-captured by GlobalPay — no confirmation call needed.+ // We route only Wallet (PayPal) CompleteAuthorize through UCS PostAuthenticate.++ fn is_post_authentication_flow_required(&self, current_flow: api::CurrentFlowInfo) -> bool {+ matches!(+ current_flow,+ api::CurrentFlowInfo::CompleteAuthorize {+ payment_method: Some(common_enums::PaymentMethod::Wallet),+ ..+ }+ )+ }}diff --git a/crates/router/src/core/payments/flows/complete_authorize_flow.rs b/crates/router/src/core/payments/flows/complete_authorize_flow.rsindex 730b49c145..4531a7724a 100644--- a/crates/router/src/core/payments/flows/complete_authorize_flow.rs+++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs@@ -509,6 +509,8 @@ impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData>);// check if redirection is not present in the response and attempt status is not AuthenticationFailed// if condition does not satisfy, then we don't need to proceed further+ // Also treat Charged/Authorized as terminal: PostAuthenticate may itself complete+ // the payment (e.g. APM confirmation), so CompleteAuthorize must not be re-fired.let should_continue = matches!(complete_authorize_router_data.response,Ok(types::PaymentsResponseData::TransactionResponse {@@ -519,6 +521,7 @@ impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData>complete_authorize_router_data.status,common_enums::AttemptStatus::AuthenticationFailed| common_enums::AttemptStatus::Failure+ | common_enums::AttemptStatus::Charged);Ok((complete_authorize_router_data, should_continue))} else {diff --git a/crates/router/src/core/unified_connector_service/connector_config.rs b/crates/router/src/core/unified_connector_service/connector_config.rsindex 2e109b2ec3..1116c0cd6e 100644--- a/crates/router/src/core/unified_connector_service/connector_config.rs+++ b/crates/router/src/core/unified_connector_service/connector_config.rs@@ -197,6 +197,11 @@ pub struct PaysafeRedirectAccountId {pub three_ds: Option<Secret<String>>,}+#[derive(Debug, serde::Deserialize)]+pub struct GlobalpayMetadata {+ account_name: Option<Secret<String>>,+}+#[derive(Debug, serde::Deserialize)]pub struct PeachpaymentsMetadata {client_merchant_reference_id: Secret<String>,@@ -365,6 +370,8 @@ pub enum ConnectorSpecificConfig {Globalpay {app_id: Secret<String>,app_key: Secret<String>,+ #[serde(skip_serializing_if = "Option::is_none")]+ account_name: Option<Secret<String>>,},/// Fiserv connector configurationFiserv {@@ -1035,10 +1042,20 @@ impl ForeignTryFrom<(Connector, &ConnectorAuthType, Option<&serde_json::Value>)>_ => Err(err("Datatrans requires BodyKey auth type")),},Connector::Globalpay => match auth {- ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self::Globalpay {- app_id: key1.clone(),- app_key: api_key.clone(),- }),+ ConnectorAuthType::BodyKey { api_key, key1 } => {+ let globalpay_meta = metadata+ .map(|m| {+ serde_json::from_value::<GlobalpayMetadata>(m.clone())+ .map_err(|_| err("Invalid Globalpay metadata format"))+ })+ .transpose()?;++ Ok(Self::Globalpay {+ app_id: key1.clone(),+ app_key: api_key.clone(),+ account_name: globalpay_meta.and_then(|m| m.account_name),+ })+ }_ => Err(err("Globalpay requires BodyKey auth type")),},Connector::Hipay => match auth {diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rsindex 10929cfbed..78c9b750f1 100644--- a/crates/router/src/core/unified_connector_service/transformers.rs+++ b/crates/router/src/core/unified_connector_service/transformers.rs@@ -1666,6 +1666,11 @@ impl.map(payments_grpc::CaptureMethod::foreign_try_from).transpose()?;+ let state = router_data+ .access_token+ .as_ref()+ .map(ConnectorState::foreign_from);+Ok(Self {merchant_order_id: Some(router_data.connector_request_reference_id.clone()),amount: router_data@@ -1702,7 +1707,7 @@ implmetadata: None,return_url: None,continue_redirection_url: None,- state: None,+ state,redirection_response: router_data.request.redirect_response@@ -1718,7 +1723,7 @@ impl.map(payments_grpc::BrowserInformation::foreign_try_from).transpose()?,connector_feature_data: None,- connector_order_reference_id: None,+ connector_order_reference_id: router_data.request.connector_transaction_id.clone(),capture_method: capture_method.map(|capture_method| capture_method.into()),})}