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_methods): fix deserialization errors for `sdk_eligible_payment_methods` (#4565)

Sarthak Sonif63a97024c75
diff --git a/config/config.example.toml b/config/config.example.toml
index b5585a84b3..f0dad483c6 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -615,4 +615,4 @@ refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
[saved_payment_methods]
-sdk_eligible_payment_methods = ["card"]
\ No newline at end of file
+sdk_eligible_payment_methods = "card"
\ No newline at end of file
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index fe47b10b54..faf3bb7f46 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -321,4 +321,4 @@ connectors_with_webhook_source_verification_call = "paypal" # List of co
keys = "user-agent"
[saved_payment_methods]
-sdk_eligible_payment_methods = ["card"]
\ No newline at end of file
+sdk_eligible_payment_methods = "card"
\ No newline at end of file
diff --git a/config/deployments/production.toml b/config/deployments/production.toml
index 3135b3d568..f564b976bc 100644
--- a/config/deployments/production.toml
+++ b/config/deployments/production.toml
@@ -332,4 +332,4 @@ connectors_with_webhook_source_verification_call = "paypal" # List of connec
keys = "user-agent"
[saved_payment_methods]
-sdk_eligible_payment_methods = ["card"]
\ No newline at end of file
+sdk_eligible_payment_methods = "card"
\ No newline at end of file
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 921301ebd6..35c8a2ba3d 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -336,4 +336,4 @@ connectors_with_webhook_source_verification_call = "paypal" # List of con
keys = "user-agent"
[saved_payment_methods]
-sdk_eligible_payment_methods = ["card"]
\ No newline at end of file
+sdk_eligible_payment_methods = "card"
\ No newline at end of file
diff --git a/config/development.toml b/config/development.toml
index db7f1ed93f..3f05872bc6 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -617,4 +617,4 @@ refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
[saved_payment_methods]
-sdk_eligible_payment_methods = ["card"]
+sdk_eligible_payment_methods = "card"
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 702d134f2d..9fd22f4670 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -476,4 +476,4 @@ refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
[saved_payment_methods]
-sdk_eligible_payment_methods = ["card"]
\ No newline at end of file
+sdk_eligible_payment_methods = "card"
\ No newline at end of file
diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs
index 12ce9c39d6..adc09fb55a 100644
--- a/crates/router/src/configs/settings.rs
+++ b/crates/router/src/configs/settings.rs
@@ -167,7 +167,9 @@ pub struct PaymentMethodAuth {
}
#[derive(Debug, Deserialize, Clone, Default)]
+#[serde(default)]
pub struct EligiblePaymentMethods {
+ #[serde(deserialize_with = "deserialize_hashset")]
pub sdk_eligible_payment_methods: HashSet<String>,
}