hyperswitch-funcdiff / prs /pr_10081.json
SirajRLX's picture
Add files using upload-large-folder tool
bcd1958 verified
{
"number": 10081,
"title": "feat(global_search): add payouts configuration and update related structures in OpenSearch",
"description": "## Type of Change\r\n<!-- Put an `x` in the boxes that apply -->\r\n\r\n- [ ] Bugfix\r\n- [x] New feature\r\n- [ ] Enhancement\r\n- [ ] Refactoring\r\n- [ ] Dependency updates\r\n- [ ] Documentation\r\n- [ ] CI/CD\r\n\r\n## Description\r\n<!-- Describe your changes in detail -->\r\n\r\n- This PR introduces OpenSearch configuration for Payouts to extend the global search capability across the platform.\r\n- The changes ensure that payout-related events and records are properly indexed in OpenSearch, enabling efficient search and retrieval within the global search framework.\r\n\r\nUpdates include:\r\n\r\n- Added payout index configuration to the OpenSearch setup.\r\n- Updated related OpenSearch mappings and environment variables.\r\n- Integrated payout index support into the existing global search query structure.\r\n- Ensured backward compatibility with existing indexes and search functionality.\r\n\r\n### Additional Changes\r\n\r\n- [ ] This PR modifies the API contract\r\n- [ ] This PR modifies the database schema\r\n- [ ] This PR modifies application configuration/environment variables\r\n\r\n<!--\r\nProvide links to the files with corresponding changes.\r\n\r\nFollowing are the paths where you can find config files:\r\n1. `config`\r\n2. `crates/router/src/configs`\r\n3. `loadtest/config`\r\n-->\r\n\r\n- Updated OpenSearch configuration files to include payout index references.\r\n- Modified environment variables to point to the new payout index setup.\r\n- Adjusted lambda and backend integration logic to align with payout index creation and synchronization.\r\n\r\n## Motivation and Context\r\n<!--\r\nWhy is this change required? What problem does it solve?\r\nIf it fixes an open issue, please link to the issue here.\r\n\r\nIf you don't have an issue, we'd recommend starting with one first so the PR\r\ncan focus on the implementation (unless it is an obvious bug or documentation fix\r\nthat will have little conversation).\r\n-->\r\nPreviously, global search did not support querying payout-related data, limiting visibility and monitoring capabilities.\r\nThis enhancement allows payout data to be indexed and searched in the same way as other payment entities, improving observability and user experience.\r\n\r\n- By adding dedicated payout OpenSearch configuration, we can now:\r\n- Enable faster and unified search across all payouts.\r\n- Support analytics and reporting pipelines with better query capabilities.\r\n- Lay groundwork for future enhancements like payout filtering and cross-entity search.\r\n\r\n## How did you test it?\r\n<!--\r\nDid you write an integration/unit/API test to verify the code changes?\r\nOr did you test this change manually (provide relevant screenshots)?\r\n-->\r\n\r\n```bash\r\ncurl 'http://localhost:9000/api/analytics/v1/search' \\\r\n -H 'Accept: */*' \\\r\n -H 'Accept-Language: en-US,en;q=0.9' \\\r\n -H 'Connection: keep-alive' \\\r\n -H 'Content-Type: application/json' \\\r\n -b 'login_token=****** \\\r\n -H 'Origin: http://localhost:9000' \\\r\n -H 'Referer: http://localhost:9000/dashboard/refunds' \\\r\n -H 'Sec-Fetch-Dest: empty' \\\r\n -H 'Sec-Fetch-Mode: cors' \\\r\n -H 'Sec-Fetch-Site: same-origin' \\\r\n -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36' \\\r\n -H 'X-Merchant-Id: merchant_123' \\\r\n -H 'X-Profile-Id: pro_*****' \\\r\n -H 'api-key: hyperswitch' \\\r\n -H 'authorization: Bearer ******\\\r\n -H 'sec-ch-ua: \"Chromium\";v=\"142\", \"Google Chrome\";v=\"142\", \"Not_A Brand\";v=\"99\"' \\\r\n -H 'sec-ch-ua-mobile: ?0' \\\r\n -H 'sec-ch-ua-platform: \"macOS\"' \\\r\n --data-raw '{\"query\":\"EUR\"}'\r\n```\r\n- Response:\r\n```json\r\n[\r\n {\r\n \"count\": 0,\r\n \"index\": \"payment_attempts\",\r\n \"hits\": [],\r\n \"status\": \"Success\"\r\n },\r\n {\r\n \"count\": 0,\r\n \"index\": \"payment_intents\",\r\n \"hits\": [],\r\n \"status\": \"Success\"\r\n },\r\n {\r\n \"count\": 0,\r\n \"index\": \"refunds\",\r\n \"hits\": [],\r\n \"status\": \"Success\"\r\n },\r\n {\r\n \"count\": 0,\r\n \"index\": \"disputes\",\r\n \"hits\": [],\r\n \"status\": \"Failure\"\r\n },\r\n {\r\n \"count\": 1,\r\n \"index\": \"payouts\",\r\n \"hits\": [\r\n {\r\n \"@timestamp\": \"2025-10-31T10:51:04Z\",\r\n \"address_id\": \"add_89nbWhahUrjUncgt0AKM\",\r\n \"amount\": 10,\r\n \"attempt_count\": 1,\r\n \"auto_fulfill\": false,\r\n \"business_country\": null,\r\n \"business_label\": null,\r\n \"connector\": null,\r\n \"connector_payout_id\": null,\r\n \"created_at\": 1761907864,\r\n \"customer_id\": \"payout_customer\",\r\n \"description\": \"Its my first payout request\",\r\n \"destination_currency\": \"EUR\",\r\n \"entity_type\": \"NaturalPerson\",\r\n \"error_code\": null,\r\n \"error_message\": null,\r\n \"headers\": {},\r\n \"is_eligible\": null,\r\n \"last_modified_at\": 1761907864,\r\n \"merchant_connector_id\": null,\r\n \"merchant_id\": \"merchant_123\",\r\n \"metadata\": {\r\n \"ref\": \"123\"\r\n },\r\n \"organization_id\": \"org_123\",\r\n \"payout_attempt_id\": \"payout_123\",\r\n \"payout_id\": \"payout_123\",\r\n \"payout_method_id\": null,\r\n \"payout_type\": null,\r\n \"priority\": null,\r\n \"profile_id\": \"pro_123\",\r\n \"recurring\": true,\r\n \"return_url\": null,\r\n \"source_currency\": \"EUR\",\r\n \"source_type\": \"kafka\",\r\n \"status\": \"requires_payout_method_data\",\r\n \"tenant_id\": \"public\",\r\n \"timestamp\": \"2025-10-31T10:51:04Z\"\r\n }\r\n ],\r\n \"status\": \"Success\"\r\n },\r\n {\r\n \"count\": 0,\r\n \"index\": \"sessionizer_payment_attempts\",\r\n \"hits\": [],\r\n \"status\": \"Failure\"\r\n },\r\n {\r\n \"count\": 0,\r\n \"index\": \"sessionizer_payment_intents\",\r\n \"hits\": [],\r\n \"status\": \"Failure\"\r\n },\r\n {\r\n \"count\": 0,\r\n \"index\": \"sessionizer_refunds\",\r\n \"hits\": [],\r\n \"status\": \"Failure\"\r\n },\r\n {\r\n \"count\": 0,\r\n \"index\": \"sessionizer_disputes\",\r\n \"hits\": [],\r\n \"status\": \"Failure\"\r\n }\r\n]\r\n```\r\n\r\n## Checklist\r\n<!-- Put an `x` in the boxes that apply -->\r\n\r\n- [x] I formatted the code `cargo +nightly fmt --all`\r\n- [x] I addressed lints thrown by `cargo clippy`\r\n- [x] I reviewed the submitted code\r\n- [x] I added unit tests for my changes where possible\r\n",
"author": "VenuMadhav2541",
"created_at": "2025-11-01T05:28:01+00:00",
"merged_at": "2025-11-10T08:26:54+00:00",
"base_branch": "main",
"labels": [
"C-feature"
],
"url": "https://github.com/juspay/hyperswitch/pull/10081",
"commits": [
{
"sha": "0a990962461d1d41a873b6cabd921e4c8465c0f6",
"message": "feat(global_search: add payouts configuration and update related structures in OpenSearch",
"author": "Venu Madhav",
"date": "2025-10-31T11:57:03+00:00",
"url": "https://github.com/juspay/hyperswitch/commit/0a990962461d1d41a873b6cabd921e4c8465c0f6"
}
]
}