diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rs index e105fab53b..8595045f1d 100644 --- a/crates/connector_configs/src/connector.rs +++ b/crates/connector_configs/src/connector.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; #[cfg(feature = "payouts")] use api_models::enums::PayoutConnectors; use api_models::{ - enums::{AuthenticationConnectors, Connector, PmAuthConnectors, TaxConnectors}, + enums::{AuthenticationConnectors, BillingConnectors, Connector, PmAuthConnectors, TaxConnectors}, payments, }; use serde::{Deserialize, Serialize}; @@ -418,6 +418,20 @@ impl ConnectorConfig { } } + pub fn get_billing_connector_config( + connector: BillingConnectors, + ) -> Result, String> { + let connector_data = Self::new()?; + match connector { + BillingConnectors::Chargebee => Ok(connector_data.chargebee), + BillingConnectors::Stripebilling => Ok(connector_data.stripebilling), + BillingConnectors::Recurly => Ok(connector_data.recurly), + BillingConnectors::Custombilling => Ok(connector_data.custombilling), + #[cfg(feature = "dummy_connector")] + BillingConnectors::DummyBillingConnector => Ok(connector_data.dummy_connector), + } + } + pub fn get_authentication_connector_config( connector: AuthenticationConnectors, ) -> Result, String> { diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml index 3188959d3b..3fbe7f3c38 100644 --- a/crates/connector_configs/toml/development.toml +++ b/crates/connector_configs/toml/development.toml @@ -1584,6 +1584,20 @@ merchant_secret="Source verification key" [celero.connector_auth.HeaderKey] api_key="Celero API Key" +[chargebee] +[chargebee.connector_auth.HeaderKey] +api_key="Chargebee API Key" + +[chargebee.connector_webhook_details] +merchant_secret="Username" +additional_secret="Password" + +[chargebee.metadata.site] +name="site" +label="Site" +placeholder="Enter chargebee site" +required=true +type="Text" [checkbook] [[checkbook.bank_transfer]] diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml index 27fe1aa62f..b1120c4311 100644 --- a/crates/connector_configs/toml/production.toml +++ b/crates/connector_configs/toml/production.toml @@ -1350,6 +1350,21 @@ merchant_secret = "Source verification key" [celero.connector_auth.HeaderKey] api_key="Celero API Key" +[chargebee] +[chargebee.connector_auth.HeaderKey] +api_key="Chargebee API Key" + +[chargebee.connector_webhook_details] +merchant_secret="Username" +additional_secret="Password" + +[chargebee.metadata.site] +name="site" +label="Site" +placeholder="Enter chargebee site" +required=true +type="Text" + [checkbook] [[checkbook.bank_transfer]] payment_method_type = "ach" diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml index 793f6c87b1..2ad76ccdec 100644 --- a/crates/connector_configs/toml/sandbox.toml +++ b/crates/connector_configs/toml/sandbox.toml @@ -1583,6 +1583,20 @@ merchant_secret = "Source verification key" [celero.connector_auth.HeaderKey] api_key="Celero API Key" +[chargebee] +[chargebee.connector_auth.HeaderKey] +api_key="Chargebee API Key" + +[chargebee.connector_webhook_details] +merchant_secret="Username" +additional_secret="Password" + +[chargebee.metadata.site] +name="site" +label="Site" +placeholder="Enter chargebee site" +required=true +type="Text" [checkbook] [[checkbook.bank_transfer]] @@ -4619,6 +4633,13 @@ required = true type = "MultiSelect" options = ["PAN_ONLY", "CRYPTOGRAM_3DS"] +[stripebilling] +[stripebilling.connector_auth.HeaderKey] +api_key="Stripe Billing API Key" + +[stripebilling.connector_webhook_details] +merchant_secret="Username" +additional_secret="Password" [stax] [[stax.credit]] diff --git a/crates/euclid_wasm/src/lib.rs b/crates/euclid_wasm/src/lib.rs index 2aaee43f7e..37ddfad990 100644 --- a/crates/euclid_wasm/src/lib.rs +++ b/crates/euclid_wasm/src/lib.rs @@ -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 {