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

feat(connector): wasm changes for Taxjar (#5879)

Swangi Kumari90ebd54ec9df
diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rs
index 3ead246702..0c64f134b1 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},
+ enums::{AuthenticationConnectors, Connector, PmAuthConnectors, TaxConnectors},
payments,
};
use serde::Deserialize;
@@ -287,6 +287,15 @@ impl ConnectorConfig {
}
}
+ pub fn get_tax_processor_config(
+ connector: TaxConnectors,
+ ) -> Result<Option<ConnectorTomlConfig>, String> {
+ let connector_data = Self::new()?;
+ match connector {
+ TaxConnectors::Taxjar => Ok(connector_data.taxjar),
+ }
+ }
+
pub fn get_pm_authentication_processor_config(
connector: PmAuthConnectors,
) -> Result<Option<ConnectorTomlConfig>, String> {
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml
index 41bcb52704..007715a92e 100644
--- a/crates/connector_configs/toml/development.toml
+++ b/crates/connector_configs/toml/development.toml
@@ -3876,6 +3876,10 @@ placeholder="Enter ThreeDS request id"
required=true
type="Text"
+[taxjar]
+[taxjar.connector_auth.HeaderKey]
+api_key="Sandbox Token"
+
[billwerk]
[[billwerk.credit]]
payment_method_type = "Mastercard"
diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml
index 8d6d2d3a5c..5d4e55a361 100644
--- a/crates/connector_configs/toml/production.toml
+++ b/crates/connector_configs/toml/production.toml
@@ -2859,6 +2859,10 @@ placeholder="Enter ThreeDS request id"
required=true
type="Text"
+[taxjar]
+[taxjar.connector_auth.HeaderKey]
+api_key="Live Token"
+
[billwerk]
[[billwerk.credit]]
payment_method_type = "Mastercard"
diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml
index 165682b750..d260970a57 100644
--- a/crates/connector_configs/toml/sandbox.toml
+++ b/crates/connector_configs/toml/sandbox.toml
@@ -3868,6 +3868,11 @@ placeholder="Enter ThreeDS request id"
required=true
type="Text"
+
+[taxjar]
+[taxjar.connector_auth.HeaderKey]
+api_key="Sandbox Token"
+
[billwerk]
[[billwerk.credit]]
payment_method_type = "Mastercard"
diff --git a/crates/euclid_wasm/src/lib.rs b/crates/euclid_wasm/src/lib.rs
index ab36031339..4f2e9aa315 100644
--- a/crates/euclid_wasm/src/lib.rs
+++ b/crates/euclid_wasm/src/lib.rs
@@ -327,6 +327,14 @@ pub fn get_authentication_connector_config(key: &str) -> JsResult {
Ok(serde_wasm_bindgen::to_value(&res)?)
}
+#[wasm_bindgen(js_name = getTaxProcessorConfig)]
+pub fn get_tax_processor_config(key: &str) -> JsResult {
+ let key = api_model_enums::TaxConnectors::from_str(key)
+ .map_err(|_| "Invalid key received".to_string())?;
+ let res = connector::ConnectorConfig::get_tax_processor_config(key)?;
+ Ok(serde_wasm_bindgen::to_value(&res)?)
+}
+
#[wasm_bindgen(js_name = getPMAuthenticationProcessorConfig)]
pub fn get_pm_authentication_processor_config(key: &str) -> JsResult {
let key: api_model_enums::PmAuthConnectors = api_model_enums::PmAuthConnectors::from_str(key)