Skip to content

Commit 46f1419

Browse files
kashif-mKashif
andauthored
fix: parse allowed_payment_method_types only if there is some value p… (#2161)
Co-authored-by: Kashif <[email protected]>
1 parent 13be4d3 commit 46f1419

File tree

1 file changed

+5
-3
lines changed
  • crates/router/src/core/payment_methods

1 file changed

+5
-3
lines changed

crates/router/src/core/payment_methods/cards.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,9 +1351,11 @@ pub async fn filter_payment_methods(
13511351
payment_intent
13521352
.allowed_payment_method_types
13531353
.clone()
1354-
.parse_value("Vec<PaymentMethodType>")
1355-
.map_err(|error| logger::error!(%error, "Failed to deserialize PaymentIntent allowed_payment_method_types"))
1356-
.ok()
1354+
.map(|val| val.parse_value("Vec<PaymentMethodType>"))
1355+
.transpose()
1356+
.unwrap_or_else(|error| {
1357+
logger::error!(%error, "Failed to deserialize PaymentIntent allowed_payment_method_types"); None
1358+
})
13571359
});
13581360

13591361
for payment_method_type_info in payment_methods_enabled

0 commit comments

Comments
 (0)