Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(euclid_wasm): add function to retrieve keys for 3ds and surcharge decision manager (#3160)

Shanks30fe9d19e495
diff --git a/crates/euclid_wasm/src/lib.rs b/crates/euclid_wasm/src/lib.rs
index 78c7677fe7..134016191f 100644
--- a/crates/euclid_wasm/src/lib.rs
+++ b/crates/euclid_wasm/src/lib.rs
@@ -6,7 +6,10 @@ use std::{
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 currency_conversion::{
conversion::convert as convert_currency, types as currency_conversion_types,
@@ -20,7 +23,7 @@ use euclid::{
},
frontend::{
ast,
- dir::{self, enums as dir_enums},
+ dir::{self, enums as dir_enums, EuclidDirFilter},
},
};
use once_cell::sync::OnceCell;
@@ -205,6 +208,18 @@ pub fn get_key_type(key: &str) -> Result<String, String> {
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)]
pub fn parser(val: String) -> String {
ron_parser::my_parse(val)