-
Notifications
You must be signed in to change notification settings - Fork 3.9k
refactor(routing): add conditional check for invoking DE routing flows #8559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Changed Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And please add validation to confirm that open router URL is not empty when open router is enabled.
true, | ||
false, | ||
); | ||
let de_euclid_connectors = if !state.conf.open_router.url.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use open_router.enabled
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want euclid for diff check even when DE is disabled. So if the env is present (the url i.e.) we'll make the call for euclid but not other algorithms as they have a open_router.enabled
check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why such a distinction?
In my opinion, this makes it harder when debugging, since someone self-hosting may have set open router enabled to false
with a placeholder URL (say referring to our sample config), expecting it to not call open router, but it would still try to?
hyperswitch/config/config.example.toml
Lines 1098 to 1100 in 102f278
[open_router] | |
enabled = true # Enable or disable Open Router | |
url = "http://localhost:8080" # Open Router URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff check is a short term process. We'll remove this check entirely in some time and rely completely on the open_router.enabled
@SanchithHegde
767a351
…ayload-webhooks * 'main' of github.com:juspay/hyperswitch: refactor(connector): Move connector mappings and endpoints to dedicated modules (#8562) ci(cypress): fix `hipay` test cases (#8563) chore(version): 2025.07.09.0 fix(payment_method): update entity id used for Vault to global customer id (#8380) refactor(routing): add conditional check for invoking DE routing flows (#8559) feat(connector): [AUTHIPAY] Integrate cards non 3ds payments (#8266) ci(cypress): add payu connector (#8567) feat(connector): [silverflow] template code (#8553) chore(version): 2025.07.08.0 feat(cypress): [worldpayvantiv] add cypress test (#8234) feat(connectors): [worldpayvantiv] add connector mandate support (#8546) feat(connector): [Celero] add Connector Template Code (#8489) feat(payment-methods): create payment_token in vault confirm / do payment-confirm with temp token from session (#8525) ci(cypress): Add Tsys,Square cypress test (#8543) chore(version): 2025.07.07.0
Type of Change
Description
This PR introduces a conditional check for Decision Engine (DE) Euclid API integration within the static routing flow. Previously, the system always attempted to perform Euclid-based routing regardless of configuration. With this change, the Euclid routing flow is invoked only if the OpenRouter URL is configured.
Additionally, some unused or redundant code around logging and comments has been cleaned up in
utils.rs
.Outcomes
Diff Hunk Explanation
crates/router/src/core/payments/routing.rs
perform_decision_euclid_routing
call with a check forstate.conf.open_router.url
.crates/router/src/core/payments/routing/utils.rs
This PR addresses an integration improvement for Euclid static routing checks in the decision engine.
Additional Changes
Motivation and Context
How did you test it?
Can be tested directly in prod as that is the only environment where this env in missing.
Checklist
cargo +nightly fmt --all
cargo clippy