From edb581e8e3307714c1ebc3dec65fc73aeb2d7cb0 Mon Sep 17 00:00:00 2001 From: Prajjwal Kumar Date: Thu, 18 Jul 2024 16:35:54 +0530 Subject: [PATCH] chore: Increasing log coverage for payment method list (#5042) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> --- crates/router/src/core/payment_methods/cards.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs index 5a4d40ef85..468bc0dbfc 100644 --- a/crates/router/src/core/payment_methods/cards.rs +++ b/crates/router/src/core/payment_methods/cards.rs @@ -2424,6 +2424,10 @@ pub async fn list_payment_methods( .await?; } } + logger::info!( + "The Payment Methods available after Constraint Graph filtering are {:?}", + response + ); // Filter out wallet payment method from mca if customer has already saved it customer @@ -3482,6 +3486,7 @@ pub async fn filter_payment_methods( .unwrap_or(true); let context = AnalysisContext::from_dir_values(context_values.clone()); + logger::info!("Context created for List Payment method is {:?}", context); let domain_ident: &[String] = &[mca_id.clone()]; let result = graph.key_value_analysis( @@ -3491,7 +3496,13 @@ pub async fn filter_payment_methods( &mut cgraph::CycleCheck::new(), Some(domain_ident), ); - if filter_pm_based_on_allowed_types + if let Err(ref e) = result { + logger::error!( + "Error while performing Constraint graph's key value analysis + for list payment methods {:?}", + e + ); + } else if filter_pm_based_on_allowed_types && filter_pm_card_network_based && saved_payment_methods_filter && matches!(result, Ok(()))