mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	fix(pm_auth): Added mca status check in pml (#5421)
This commit is contained in:
		| @ -2356,7 +2356,8 @@ pub async fn list_payment_methods( | ||||
|     .await?; | ||||
|  | ||||
|     // filter out connectors based on the business country | ||||
|     let filtered_mcas = helpers::filter_mca_based_on_business_profile(all_mcas, profile_id.clone()); | ||||
|     let filtered_mcas = | ||||
|         helpers::filter_mca_based_on_business_profile(all_mcas.clone(), profile_id.clone()); | ||||
|  | ||||
|     logger::debug!(mca_before_filtering=?filtered_mcas); | ||||
|  | ||||
| @ -2663,11 +2664,13 @@ pub async fn list_payment_methods( | ||||
|                     }); | ||||
|  | ||||
|                 if let Some(config) = pm_auth_config { | ||||
|                     config | ||||
|                         .enabled_payment_methods | ||||
|                     for inner_config in config.enabled_payment_methods.iter() { | ||||
|                         let is_active_mca = all_mcas | ||||
|                             .iter() | ||||
|                         .for_each(|inner_config| { | ||||
|                             if inner_config.payment_method_type == *payment_method_type { | ||||
|                             .any(|mca| mca.merchant_connector_id == inner_config.mca_id); | ||||
|  | ||||
|                         if inner_config.payment_method_type == *payment_method_type && is_active_mca | ||||
|                         { | ||||
|                             let pm = pmt_to_auth_connector | ||||
|                                 .get(&inner_config.payment_method) | ||||
|                                 .cloned(); | ||||
| @ -2685,11 +2688,10 @@ pub async fn list_payment_methods( | ||||
|                                 )]) | ||||
|                             }; | ||||
|  | ||||
|                                 pmt_to_auth_connector | ||||
|                                     .insert(inner_config.payment_method, inner_map); | ||||
|                             pmt_to_auth_connector.insert(inner_config.payment_method, inner_map); | ||||
|                             val.push(inner_config.clone()); | ||||
|                         } | ||||
|                         }); | ||||
|                     } | ||||
|                 }; | ||||
|             } | ||||
|         } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Sarthak Soni
					Sarthak Soni