add wasm function for billing connectors

This commit is contained in:
Spriti Aneja
2025-10-24 17:09:47 +05:30
parent 7b70d2454e
commit a805cadbda
5 changed files with 73 additions and 1 deletions

View File

@ -381,6 +381,14 @@ pub fn get_connector_config(key: &str) -> JsResult {
Ok(serde_wasm_bindgen::to_value(&res)?)
}
#[wasm_bindgen(js_name = getBillingConnectorConfig)]
pub fn get_billing_connector_config(key: &str) -> JsResult {
let key = api_model_enums::BillingConnectors::from_str(key)
.map_err(|_| "Invalid key received".to_string())?;
let res = connector::ConnectorConfig::get_billing_connector_config(key)?;
Ok(serde_wasm_bindgen::to_value(&res)?)
}
#[cfg(feature = "payouts")]
#[wasm_bindgen(js_name = getPayoutConnectorConfig)]
pub fn get_payout_connector_config(key: &str) -> JsResult {