juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.64k stars 1.36k forks source link

refactor(core): add profile_id for default_fallback api #6546

Closed prajjwalkumar17 closed 1 week ago

prajjwalkumar17 commented 1 week ago

Type of Change

Description

This will refactor the route routing/default/profile Previously the output for this route was the default fallback connectors from all the profiles, After this refactor it will have the fallback connectors only for the mentioned profile. If the profile_id is provided by the authentication layer, if not it will behave as previous by taking the merchant_id from auth layer.

Moreover we have removed 2 routes from backed as these were not being used(Dahboard as well as internal apis), hence were redundant. GET routing/default POST routing/default

Additional Changes

Motivation and Context

Required by our Dashboard to move the api's under profile level

How did you test it?

curl --location 'http://127.0.0.1:8080/routing/default/profile' \
--header 'Authorization: Bearer token

This should have the connectors from the mentioned profile only.

[
    {
        "connector": "bankofamerica",
        "merchant_connector_id": "mca_ADICIF9zh09TjnpUgusU"
    }
]

Checklist

semanticdiff-com[bot] commented 1 week ago

Review changes with  SemanticDiff

Changed Files
| File | Status | | :--- | :--- | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6546/changes#crates/router/src/core/routing.rs)  [crates/router/src/core/routing\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6546/changes#crates/router/src/core/routing.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6546/changes#crates/router/src/core/routing.rs)  80% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6546/changes#crates/router/src/routes/app.rs)  [crates/router/src/routes/app\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6546/changes#crates/router/src/routes/app.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6546/changes#crates/router/src/routes/app.rs)  78% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6546/changes#crates/router/src/routes/routing.rs)  [crates/router/src/routes/routing\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6546/changes#crates/router/src/routes/routing.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6546/changes#crates/router/src/routes/routing.rs)  43% smaller |