mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(connector): wasm changes for Taxjar (#5879)
This commit is contained in:
@ -3,7 +3,7 @@ use std::collections::HashMap;
|
|||||||
#[cfg(feature = "payouts")]
|
#[cfg(feature = "payouts")]
|
||||||
use api_models::enums::PayoutConnectors;
|
use api_models::enums::PayoutConnectors;
|
||||||
use api_models::{
|
use api_models::{
|
||||||
enums::{AuthenticationConnectors, Connector, PmAuthConnectors},
|
enums::{AuthenticationConnectors, Connector, PmAuthConnectors, TaxConnectors},
|
||||||
payments,
|
payments,
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
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(
|
pub fn get_pm_authentication_processor_config(
|
||||||
connector: PmAuthConnectors,
|
connector: PmAuthConnectors,
|
||||||
) -> Result<Option<ConnectorTomlConfig>, String> {
|
) -> Result<Option<ConnectorTomlConfig>, String> {
|
||||||
|
|||||||
@ -3876,6 +3876,10 @@ placeholder="Enter ThreeDS request id"
|
|||||||
required=true
|
required=true
|
||||||
type="Text"
|
type="Text"
|
||||||
|
|
||||||
|
[taxjar]
|
||||||
|
[taxjar.connector_auth.HeaderKey]
|
||||||
|
api_key="Sandbox Token"
|
||||||
|
|
||||||
[billwerk]
|
[billwerk]
|
||||||
[[billwerk.credit]]
|
[[billwerk.credit]]
|
||||||
payment_method_type = "Mastercard"
|
payment_method_type = "Mastercard"
|
||||||
|
|||||||
@ -2859,6 +2859,10 @@ placeholder="Enter ThreeDS request id"
|
|||||||
required=true
|
required=true
|
||||||
type="Text"
|
type="Text"
|
||||||
|
|
||||||
|
[taxjar]
|
||||||
|
[taxjar.connector_auth.HeaderKey]
|
||||||
|
api_key="Live Token"
|
||||||
|
|
||||||
[billwerk]
|
[billwerk]
|
||||||
[[billwerk.credit]]
|
[[billwerk.credit]]
|
||||||
payment_method_type = "Mastercard"
|
payment_method_type = "Mastercard"
|
||||||
|
|||||||
@ -3868,6 +3868,11 @@ placeholder="Enter ThreeDS request id"
|
|||||||
required=true
|
required=true
|
||||||
type="Text"
|
type="Text"
|
||||||
|
|
||||||
|
|
||||||
|
[taxjar]
|
||||||
|
[taxjar.connector_auth.HeaderKey]
|
||||||
|
api_key="Sandbox Token"
|
||||||
|
|
||||||
[billwerk]
|
[billwerk]
|
||||||
[[billwerk.credit]]
|
[[billwerk.credit]]
|
||||||
payment_method_type = "Mastercard"
|
payment_method_type = "Mastercard"
|
||||||
|
|||||||
@ -327,6 +327,14 @@ pub fn get_authentication_connector_config(key: &str) -> JsResult {
|
|||||||
Ok(serde_wasm_bindgen::to_value(&res)?)
|
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)]
|
#[wasm_bindgen(js_name = getPMAuthenticationProcessorConfig)]
|
||||||
pub fn get_pm_authentication_processor_config(key: &str) -> JsResult {
|
pub fn get_pm_authentication_processor_config(key: &str) -> JsResult {
|
||||||
let key: api_model_enums::PmAuthConnectors = api_model_enums::PmAuthConnectors::from_str(key)
|
let key: api_model_enums::PmAuthConnectors = api_model_enums::PmAuthConnectors::from_str(key)
|
||||||
|
|||||||
Reference in New Issue
Block a user