Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wasm): fix feature dependencies in connector_configs crate for WASM builds #6832

Merged
merged 8 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -246,25 +245,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 @@ -2895,9 +2895,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 @@ -2936,11 +2933,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 @@ -3941,11 +3939,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"]
Expand Down
Loading