Skip to content

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

chore: Added modular config key for Paylater and Wallet HS<>UCS (#11246)

Amitsingh Tanwar68d81ba6c3ff
diff --git a/crates/router/src/core/unified_connector_service.rs b/crates/router/src/core/unified_connector_service.rs
index e69c58f42d..9d52451c63 100644
--- a/crates/router/src/core/unified_connector_service.rs
+++ b/crates/router/src/core/unified_connector_service.rs
@@ -258,6 +258,7 @@ where
connector_name,
&flow_name,
router_data.payment_method,
+ router_data.payment_method_type,
);
// Determine connector integration type
@@ -456,6 +457,7 @@ fn build_rollout_keys(
connector_name: &str,
flow_name: &str,
payment_method: common_enums::PaymentMethod,
+ payment_method_type: Option<PaymentMethodType>,
) -> String {
// Detect if this is a refund flow based on flow name
let is_refund_flow = matches!(flow_name, "Execute" | "RSync");
@@ -470,17 +472,51 @@ fn build_rollout_keys(
flow_name
)
} else {
- // Payment flows: UCS_merchant_connector_paymentmethod_flow (e.g., UCS_merchant123_stripe_card_Authorize)
- let payment_method_str = payment_method.to_string();
- format!(
- "{}_{}_{}_{}_{}",
- consts::UCS_ROLLOUT_PERCENT_CONFIG_PREFIX,
- merchant_id,
- connector_name,
- payment_method_str,
- flow_name
- )
+ match payment_method {
+ common_enums::PaymentMethod::Wallet
+ | common_enums::PaymentMethod::BankRedirect
+ | common_enums::PaymentMethod::Voucher
+ | common_enums::PaymentMethod::PayLater => {
+ let payment_method_str = payment_method.to_string();
+ let payment_method_type_str = payment_method_type
+ .map(|pmt| pmt.to_string())
+ .unwrap_or_else(|| "unknown".to_string());
+ format!(
+ "{}_{}_{}_{}_{}_{}",
+ consts::UCS_ROLLOUT_PERCENT_CONFIG_PREFIX,
+ merchant_id,
+ connector_name,
+ payment_method_str,
+ payment_method_type_str,
+ flow_name
+ )
+ }
+ common_enums::PaymentMethod::Card
+ | common_enums::PaymentMethod::CardRedirect
+ | common_enums::PaymentMethod::Upi
+ | common_enums::PaymentMethod::Crypto
+ | common_enums::PaymentMethod::Reward
+ | common_enums::PaymentMethod::BankDebit
+ | common_enums::PaymentMethod::RealTimePayment
+ | common_enums::PaymentMethod::BankTransfer
+ | common_enums::PaymentMethod::GiftCard
+ | common_enums::PaymentMethod::MobilePayment
+ | common_enums::PaymentMethod::NetworkToken
+ | common_enums::PaymentMethod::OpenBanking => {
+ // For other payment methods, use a generic format without specific payment method type details
+ let payment_method_str = payment_method.to_string();
+ format!(
+ "{}_{}_{}_{}_{}",
+ consts::UCS_ROLLOUT_PERCENT_CONFIG_PREFIX,
+ merchant_id,
+ connector_name,
+ payment_method_str,
+ flow_name
+ )
+ }
+ }
};
+
rollout_key
}