Skip to content

refactor(routing): update configs on updation of mca#9659

Merged
Gnanasundari24 merged 8 commits intomainfrom
fix_default_routing
Oct 7, 2025
Merged

refactor(routing): update configs on updation of mca#9659
Gnanasundari24 merged 8 commits intomainfrom
fix_default_routing

Conversation

@prajjwalkumar17
Copy link
Member

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This pull request introduces a new helper function to update the default fallback connector configuration whenever a merchant connector account (MCA) is updated. This ensures that changes to connector status (such as disabling or enabling) are accurately reflected in both merchant and profile configurations. The changes also include necessary imports and function calls to integrate this logic into the connector update flow.

Connector fallback configuration updates:

  • Added the update_default_fallback_on_mca_update function in routing/helpers.rs to update merchant and profile default connector configurations based on the status of the updated MCA. The function ensures that disabled or inactive connectors are removed from the defaults, and enabled connectors are added if not already present.
  • Integrated the new helper into the update_connector flow in admin.rs, so it is triggered automatically after connector updates.

Imports and code organization:

  • Added necessary imports for update_default_fallback_on_mca_update and related types in admin.rs and helpers.rs to support the new logic. [1] [2]

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

How did you test it?

  1. Create two connectors namely adyen and wise
  2. check configs table
 SELECT key, config
FROM configs
WHERE key = 'routing_default_po_pro_RTMoW14AvhG5cjmcpcNb';
 SELECT key, config
FROM configs
WHERE key = 'routing_default_po_merchant_id';
  1. disable one of them
  2. check configs table again for above query, this time the disabled shouldn't be present.
  3. Re-enable the disabled connector, then query the table for the connector to be added back.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@prajjwalkumar17 prajjwalkumar17 requested review from a team as code owners October 3, 2025 11:06
@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 3, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/admin.rs  0% smaller
  crates/router/src/core/routing.rs  0% smaller
  crates/router/src/core/routing/helpers.rs  0% smaller

@prajjwalkumar17 prajjwalkumar17 self-assigned this Oct 3, 2025
@prajjwalkumar17 prajjwalkumar17 added the A-routing Area: Routing label Oct 3, 2025
@prajjwalkumar17 prajjwalkumar17 linked an issue Oct 3, 2025 that may be closed by this pull request
@Sarthak1799
Copy link
Contributor

All checks are failing @prajjwalkumar17
Please fix the required checks.

Sarthak1799
Sarthak1799 previously approved these changes Oct 3, 2025
ShankarSinghC
ShankarSinghC previously approved these changes Oct 3, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Oct 7, 2025
Merged via the queue into main with commit 286e18b Oct 7, 2025
22 of 25 checks passed
@Gnanasundari24 Gnanasundari24 deleted the fix_default_routing branch October 7, 2025 16:53
UdayPandey01 pushed a commit to UdayPandey01/hyperswitch that referenced this pull request Oct 8, 2025
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Gnanasundari24 <118818938+Gnanasundari24@users.noreply.github.com>
aadityaguptaa pushed a commit that referenced this pull request Nov 10, 2025
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Gnanasundari24 <118818938+Gnanasundari24@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-routing Area: Routing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants