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

feat(global_search): add payouts configuration and update related structures in OpenSearch (#10081)

Venu Madhav Bandarupalli5fb8b46d049c
diff --git a/config/config.example.toml b/config/config.example.toml
index d727114c9a..78b23c105d 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -1158,6 +1158,7 @@ payment_attempts = "hyperswitch-payment-attempt-events"
payment_intents = "hyperswitch-payment-intent-events"
refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
+payouts = "hyperswitch-payout-events"
sessionizer_payment_attempts = "sessionizer-payment-attempt-events"
sessionizer_payment_intents = "sessionizer-payment-intent-events"
sessionizer_refunds = "sessionizer-refund-events"
diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.toml
index c3e0618166..2ea9388103 100644
--- a/config/deployments/env_specific.toml
+++ b/config/deployments/env_specific.toml
@@ -266,6 +266,7 @@ payment_attempts = "hyperswitch-payment-attempt-events"
payment_intents = "hyperswitch-payment-intent-events"
refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
+payouts = "hyperswitch-payout-events"
sessionizer_payment_attempts = "sessionizer-payment-attempt-events"
sessionizer_payment_intents = "sessionizer-payment-intent-events"
sessionizer_refunds = "sessionizer-refund-events"
diff --git a/config/development.toml b/config/development.toml
index f1c6d2ce23..ec723a387d 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -1296,6 +1296,7 @@ payment_attempts = "hyperswitch-payment-attempt-events"
payment_intents = "hyperswitch-payment-intent-events"
refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
+payouts = "hyperswitch-payout-events"
sessionizer_payment_attempts = "sessionizer-payment-attempt-events"
sessionizer_payment_intents = "sessionizer-payment-intent-events"
sessionizer_refunds = "sessionizer-refund-events"
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 2a66fdef4e..f6b443dc2e 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -1151,6 +1151,7 @@ payment_attempts = "hyperswitch-payment-attempt-events"
payment_intents = "hyperswitch-payment-intent-events"
refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
+payouts = "hyperswitch-payout-events"
sessionizer_payment_attempts = "sessionizer-payment-attempt-events"
sessionizer_payment_intents = "sessionizer-payment-intent-events"
sessionizer_refunds = "sessionizer-refund-events"
diff --git a/config/vector.yaml b/config/vector.yaml
index 89e33da57b..2e8e7f568b 100644
--- a/config/vector.yaml
+++ b/config/vector.yaml
@@ -16,6 +16,7 @@ sources:
- hyperswitch-payment-intent-events
- hyperswitch-refund-events
- hyperswitch-dispute-events
+ - hyperswitch-payout-events
decoding:
codec: json
diff --git a/crates/analytics/src/opensearch.rs b/crates/analytics/src/opensearch.rs
index 47714e47ea..47632e62b8 100644
--- a/crates/analytics/src/opensearch.rs
+++ b/crates/analytics/src/opensearch.rs
@@ -43,6 +43,7 @@ pub struct OpenSearchIndexes {
pub payment_intents: String,
pub refunds: String,
pub disputes: String,
+ pub payouts: String,
pub sessionizer_payment_attempts: String,
pub sessionizer_payment_intents: String,
pub sessionizer_refunds: String,
@@ -88,6 +89,7 @@ impl Default for OpenSearchConfig {
payment_intents: "hyperswitch-payment-intent-events".to_string(),
refunds: "hyperswitch-refund-events".to_string(),
disputes: "hyperswitch-dispute-events".to_string(),
+ payouts: "hyperswitch-payout-events".to_string(),
sessionizer_payment_attempts: "sessionizer-payment-attempt-events".to_string(),
sessionizer_payment_intents: "sessionizer-payment-intent-events".to_string(),
sessionizer_refunds: "sessionizer-refund-events".to_string(),
@@ -239,6 +241,7 @@ impl OpenSearchClient {
SearchIndex::PaymentIntents => self.indexes.payment_intents.clone(),
SearchIndex::Refunds => self.indexes.refunds.clone(),
SearchIndex::Disputes => self.indexes.disputes.clone(),
+ SearchIndex::Payouts => self.indexes.payouts.clone(),
SearchIndex::SessionizerPaymentAttempts => {
self.indexes.sessionizer_payment_attempts.clone()
}
@@ -352,6 +355,12 @@ impl OpenSearchIndexes {
))
})?;
+ when(self.payouts.is_default_or_empty(), || {
+ Err(ApplicationError::InvalidConfigurationValueError(
+ "Opensearch Payouts index must not be empty".into(),
+ ))
+ })?;
+
when(
self.sessionizer_payment_attempts.is_default_or_empty(),
|| {
diff --git a/crates/api_models/src/analytics/search.rs b/crates/api_models/src/analytics/search.rs
index 06426efde6..ab22be377d 100644
--- a/crates/api_models/src/analytics/search.rs
+++ b/crates/api_models/src/analytics/search.rs
@@ -72,6 +72,7 @@ pub enum SearchIndex {
PaymentIntents,
Refunds,
Disputes,
+ Payouts,
SessionizerPaymentAttempts,
SessionizerPaymentIntents,
SessionizerRefunds,
diff --git a/crates/router/src/consts/opensearch.rs b/crates/router/src/consts/opensearch.rs
index c9eeec1b34..e2a33e47bf 100644
--- a/crates/router/src/consts/opensearch.rs
+++ b/crates/router/src/consts/opensearch.rs
@@ -1,11 +1,12 @@
use api_models::analytics::search::SearchIndex;
-pub const fn get_search_indexes() -> [SearchIndex; 8] {
+pub const fn get_search_indexes() -> [SearchIndex; 9] {
[
SearchIndex::PaymentAttempts,
SearchIndex::PaymentIntents,
SearchIndex::Refunds,
SearchIndex::Disputes,
+ SearchIndex::Payouts,
SearchIndex::SessionizerPaymentAttempts,
SearchIndex::SessionizerPaymentIntents,
SearchIndex::SessionizerRefunds,
@@ -13,4 +14,4 @@ pub const fn get_search_indexes() -> [SearchIndex; 8] {
]
}
-pub const SEARCH_INDEXES: [SearchIndex; 8] = get_search_indexes();
+pub const SEARCH_INDEXES: [SearchIndex; 9] = get_search_indexes();