Skip to content

Commit

Permalink
fix(wasm): fix feature dependencies in connector_configs crate for …
Browse files Browse the repository at this point in the history
…WASM builds (#6832)

Co-authored-by: Chikke Srujan <[email protected]>
Co-authored-by: Jeeva Ramachandran <[email protected]>
  • Loading branch information
3 people authored Dec 23, 2024
1 parent 0478731 commit 6eabc82
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 38 deletions.
3 changes: 1 addition & 2 deletions crates/connector_configs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ license.workspace = true
[features]
default = ["payouts", "dummy_connector"]
production = []
development = []
sandbox = []
dummy_connector = ["api_models/dummy_connector", "development"]
dummy_connector = ["api_models/dummy_connector"]
payouts = ["api_models/payouts"]
v1 = ["api_models/v1", "common_utils/v1"]

Expand Down
28 changes: 8 additions & 20 deletions crates/connector_configs/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use api_models::{
payments,
};
use serde::Deserialize;
#[cfg(any(feature = "sandbox", feature = "development", feature = "production"))]
use toml;

use crate::common_config::{CardProvider, InputData, Provider, ZenApplePay};
Expand Down Expand Up @@ -254,25 +253,14 @@ pub struct ConnectorConfig {

impl ConnectorConfig {
fn new() -> Result<Self, String> {
#[cfg(all(
feature = "production",
not(any(feature = "sandbox", feature = "development"))
))]
let config = toml::from_str::<Self>(include_str!("../toml/production.toml"));
#[cfg(all(
feature = "sandbox",
not(any(feature = "production", feature = "development"))
))]
let config = toml::from_str::<Self>(include_str!("../toml/sandbox.toml"));
#[cfg(feature = "development")]
let config = toml::from_str::<Self>(include_str!("../toml/development.toml"));

#[cfg(not(any(feature = "sandbox", feature = "development", feature = "production")))]
return Err(String::from(
"Atleast one features has to be enabled for connectorconfig",
));

#[cfg(any(feature = "sandbox", feature = "development", feature = "production"))]
let config_str = if cfg!(feature = "production") {
include_str!("../toml/production.toml")
} else if cfg!(feature = "sandbox") {
include_str!("../toml/sandbox.toml")
} else {
include_str!("../toml/development.toml")
};
let config = toml::from_str::<Self>(config_str);
match config {
Ok(data) => Ok(data),
Err(err) => Err(err.to_string()),
Expand Down
8 changes: 0 additions & 8 deletions crates/connector_configs/toml/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2935,9 +2935,6 @@ merchant_secret="Source verification key"
api_key="API Key"
[zen.connector_webhook_details]
merchant_secret="Source verification key"
[zen.metadata.apple_pay]
terminal_uuid="Terminal UUID"
pay_wall_secret="Pay Wall Secret"

[[zen.metadata.apple_pay]]
name="terminal_uuid"
Expand Down Expand Up @@ -2976,11 +2973,6 @@ key1 = "Merchant ID"
[netcetera.connector_auth.CertificateAuth]
certificate="Base64 encoded PEM formatted certificate chain"
private_key="Base64 encoded PEM formatted private key"
[netcetera.metadata]
merchant_country_code="3 digit numeric country code"
merchant_name="Name of the merchant"
three_ds_requestor_name="ThreeDS requestor name"
three_ds_requestor_id="ThreeDS request id"

[netcetera.metadata.endpoint_prefix]
name="endpoint_prefix"
Expand Down
7 changes: 0 additions & 7 deletions crates/connector_configs/toml/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,6 @@ merchant_secret="Source verification key"
[airwallex.connector_auth.BodyKey]
api_key="API Key"
key1="Client ID"
[airwallex.connector_webhook_details]
merchant_secret="Source verification key"

[airwallex.connector_webhook_details]
merchant_secret="Source verification key"
Expand Down Expand Up @@ -3981,11 +3979,6 @@ type="Toggle"
[netcetera.connector_auth.CertificateAuth]
certificate="Base64 encoded PEM formatted certificate chain"
private_key="Base64 encoded PEM formatted private key"
[netcetera.metadata]
merchant_country_code="3 digit numeric country code"
merchant_name="Name of the merchant"
three_ds_requestor_name="ThreeDS requestor name"
three_ds_requestor_id="ThreeDS request id"

[netcetera.metadata.endpoint_prefix]
name="endpoint_prefix"
Expand Down
1 change: 0 additions & 1 deletion crates/euclid_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ default = ["payouts"]
release = ["payouts"]
dummy_connector = ["kgraph_utils/dummy_connector", "connector_configs/dummy_connector"]
production = ["connector_configs/production"]
development = ["connector_configs/development"]
sandbox = ["connector_configs/sandbox"]
payouts = ["api_models/payouts", "euclid/payouts"]
v1 = ["api_models/v1", "kgraph_utils/v1"]
Expand Down

0 comments on commit 6eabc82

Please sign in to comment.