mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
fix(euclid_wasm): add function to retrieve keys for 3ds and surcharge decision manager (#3160)
Co-authored-by: hrithikeshvm <hrithikeshmylatty@gmail.com>
This commit is contained in:
@ -6,7 +6,10 @@ use std::{
|
|||||||
str::FromStr,
|
str::FromStr,
|
||||||
};
|
};
|
||||||
|
|
||||||
use api_models::{admin as admin_api, routing::ConnectorSelection};
|
use api_models::{
|
||||||
|
admin as admin_api, conditional_configs::ConditionalConfigs, routing::ConnectorSelection,
|
||||||
|
surcharge_decision_configs::SurchargeDecisionConfigs,
|
||||||
|
};
|
||||||
use common_enums::RoutableConnectors;
|
use common_enums::RoutableConnectors;
|
||||||
use currency_conversion::{
|
use currency_conversion::{
|
||||||
conversion::convert as convert_currency, types as currency_conversion_types,
|
conversion::convert as convert_currency, types as currency_conversion_types,
|
||||||
@ -20,7 +23,7 @@ use euclid::{
|
|||||||
},
|
},
|
||||||
frontend::{
|
frontend::{
|
||||||
ast,
|
ast,
|
||||||
dir::{self, enums as dir_enums},
|
dir::{self, enums as dir_enums, EuclidDirFilter},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use once_cell::sync::OnceCell;
|
use once_cell::sync::OnceCell;
|
||||||
@ -205,6 +208,18 @@ pub fn get_key_type(key: &str) -> Result<String, String> {
|
|||||||
Ok(key_str)
|
Ok(key_str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen(js_name = getThreeDsKeys)]
|
||||||
|
pub fn get_three_ds_keys() -> JsResult {
|
||||||
|
let keys = <ConditionalConfigs as EuclidDirFilter>::ALLOWED;
|
||||||
|
Ok(serde_wasm_bindgen::to_value(keys)?)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen(js_name= getSurchargeKeys)]
|
||||||
|
pub fn get_surcharge_keys() -> JsResult {
|
||||||
|
let keys = <SurchargeDecisionConfigs as EuclidDirFilter>::ALLOWED;
|
||||||
|
Ok(serde_wasm_bindgen::to_value(keys)?)
|
||||||
|
}
|
||||||
|
|
||||||
#[wasm_bindgen(js_name=parseToString)]
|
#[wasm_bindgen(js_name=parseToString)]
|
||||||
pub fn parser(val: String) -> String {
|
pub fn parser(val: String) -> String {
|
||||||
ron_parser::my_parse(val)
|
ron_parser::my_parse(val)
|
||||||
|
|||||||
Reference in New Issue
Block a user