feat(payments_v2): add payment method list endpoint (#6805)

Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Narayan Bhat
2024-12-23 15:37:16 +05:30
committed by GitHub
parent 1fc941056f
commit d4b3dbc155
45 changed files with 1307 additions and 721 deletions

View File

@ -7,8 +7,8 @@ use std::{
};
use api_models::{
admin as admin_api, conditional_configs::ConditionalConfigs, enums as api_model_enums,
routing::ConnectorSelection, surcharge_decision_configs::SurchargeDecisionConfigs,
conditional_configs::ConditionalConfigs, enums as api_model_enums, routing::ConnectorSelection,
surcharge_decision_configs::SurchargeDecisionConfigs,
};
use common_enums::RoutableConnectors;
use connector_configs::{
@ -20,7 +20,7 @@ use currency_conversion::{
};
use euclid::{
backend::{inputs, interpreter::InterpreterBackend, EuclidBackend},
dssa::{self, analyzer, graph::CgraphExt, state_machine, truth},
dssa::{self, analyzer, graph::CgraphExt, state_machine},
frontend::{
ast,
dir::{self, enums as dir_enums, EuclidDirFilter},
@ -76,9 +76,11 @@ pub fn convert_forex_value(amount: i64, from_currency: JsValue, to_currency: JsV
/// This function can be used by the frontend to provide the WASM with information about
/// all the merchant's connector accounts. The input argument is a vector of all the merchant's
/// connector accounts from the API.
#[cfg(feature = "v1")]
#[wasm_bindgen(js_name = seedKnowledgeGraph)]
pub fn seed_knowledge_graph(mcas: JsValue) -> JsResult {
let mcas: Vec<admin_api::MerchantConnectorResponse> = serde_wasm_bindgen::from_value(mcas)?;
let mcas: Vec<api_models::admin::MerchantConnectorResponse> =
serde_wasm_bindgen::from_value(mcas)?;
let connectors: Vec<ast::ConnectorChoice> = mcas
.iter()
.map(|mca| {
@ -95,9 +97,11 @@ pub fn seed_knowledge_graph(mcas: JsValue) -> JsResult {
default_configs: Some(pm_filter),
};
let mca_graph = kgraph_utils::mca::make_mca_graph(mcas, &config).err_to_js()?;
let analysis_graph =
hyperswitch_constraint_graph::ConstraintGraph::combine(&mca_graph, &truth::ANALYSIS_GRAPH)
.err_to_js()?;
let analysis_graph = hyperswitch_constraint_graph::ConstraintGraph::combine(
&mca_graph,
&dssa::truth::ANALYSIS_GRAPH,
)
.err_to_js()?;
SEED_DATA
.set(SeedData {