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

fix(payment_link): drop runtime router_env dependency to unblock wasm build (#13369)

XyneSpaces6da8cefa45dd
diff --git a/.github/workflows/wasm-bulild-check.yml b/.github/workflows/wasm-bulild-check.yml
index e2c8b0a067..321da4ee28 100644
--- a/.github/workflows/wasm-bulild-check.yml
+++ b/.github/workflows/wasm-bulild-check.yml
@@ -32,3 +32,7 @@ jobs:
- name: wasm build
shell: bash
run: make euclid-wasm
+
+ - name: payment-link wasm build
+ shell: bash
+ run: make payment-link-wasm
diff --git a/Cargo.lock b/Cargo.lock
index 65bbed7d59..5949368f42 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6815,6 +6815,7 @@ dependencies = [
"tera",
"thiserror 1.0.69",
"toml 0.8.22",
+ "tracing",
"url 2.5.4",
"urlencoding",
"wasm-bindgen",
diff --git a/Makefile b/Makefile
index 7614ff25ca..cc6089c46f 100644
--- a/Makefile
+++ b/Makefile
@@ -86,6 +86,14 @@ clippy :
euclid-wasm:
wasm-pack build --target web --out-dir $(ROOT_DIR)/wasm --out-name euclid $(ROOT_DIR)/crates/euclid_wasm -- --features dummy_connector,v1
+# Build the payment_link crate as a WebAssembly JS library
+#
+# Usage :
+# make payment-link-wasm
+
+payment-link-wasm:
+ wasm-pack build --target web --out-dir $(ROOT_DIR)/wasm/payment_link --out-name payment_link $(ROOT_DIR)/crates/payment_link -- --no-default-features --features v1,wasm
+
# Run Rust tests of project.
#
# Usage :
diff --git a/crates/payment_link/Cargo.toml b/crates/payment_link/Cargo.toml
index aca35bc66c..7835e015be 100644
--- a/crates/payment_link/Cargo.toml
+++ b/crates/payment_link/Cargo.toml
@@ -25,12 +25,12 @@ error-stack = "0.4.1"
thiserror = "1.0.69"
wasm-bindgen = { version = "0.2", optional = true }
lightningcss = "1.0.0-alpha.71"
+tracing = { workspace = true }
# First party crates
api_models = { path = "../api_models", default-features = false }
common_utils = { path = "../common_utils" }
getrandom = { version = "0.3", optional = true }
-router_env = { path = "../router_env" }
[build-dependencies]
router_env = { path = "../router_env" }
diff --git a/crates/payment_link/src/css_generator.rs b/crates/payment_link/src/css_generator.rs
index fdf568d426..95f6c3e04a 100644
--- a/crates/payment_link/src/css_generator.rs
+++ b/crates/payment_link/src/css_generator.rs
@@ -10,7 +10,7 @@ use lightningcss::{
stylesheet::{ParserOptions, PrinterOptions, StyleSheet},
traits::ToCss,
};
-use router_env::logger;
+use tracing as logger;
#[derive(Debug, thiserror::Error)]
pub enum PaymentLinkError {