mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-01 02:57:02 +08:00 
			
		
		
		
	fix(frm): restrict enabled mca for frm connectors (#5499)
Signed-off-by: Chikke Srujan <chikke.srujan@Chikke-Srujan-N7WRTY72X7.local> Co-authored-by: Chikke Srujan <chikke.srujan@Chikke-Srujan-N7WRTY72X7.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -183,10 +183,26 @@ pub async fn should_call_frm<F: Send + Clone>( | ||||
|                     &key_store, | ||||
|                 ) | ||||
|                 .await | ||||
|                 .change_context(errors::ApiErrorResponse::MerchantConnectorAccountNotFound { | ||||
|                     id: merchant_account.get_id().get_string_repr().to_owned(), | ||||
|                 .map_err(|error| { | ||||
|                     logger::error!( | ||||
|                         "{:?}", | ||||
|                         error.change_context( | ||||
|                             errors::ApiErrorResponse::MerchantConnectorAccountNotFound { | ||||
|                                 id: merchant_account.get_id().get_string_repr().to_owned(), | ||||
|                             } | ||||
|                         ) | ||||
|                     ) | ||||
|                 }) | ||||
|                 .ok(); | ||||
|             let enabled_merchant_connector_account_from_db_option = | ||||
|                 merchant_connector_account_from_db_option.and_then(|mca| { | ||||
|                     if mca.disabled.unwrap_or(false) { | ||||
|                         logger::info!("No eligible connector found for FRM"); | ||||
|                         None | ||||
|                     } else { | ||||
|                         Some(mca) | ||||
|                     } | ||||
|                 }); | ||||
|  | ||||
|             #[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))] | ||||
|             let merchant_connector_account_from_db_option: Option< | ||||
| @ -198,7 +214,7 @@ pub async fn should_call_frm<F: Send + Clone>( | ||||
|                 todo!() | ||||
|             }; | ||||
|  | ||||
|             match merchant_connector_account_from_db_option { | ||||
|             match enabled_merchant_connector_account_from_db_option { | ||||
|                 Some(merchant_connector_account_from_db) => { | ||||
|                     let frm_configs_option = merchant_connector_account_from_db | ||||
|                         .frm_configs | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 chikke srujan
					chikke srujan