mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-04 14:07:18 +08:00 
			
		
		
		
	feat(payouts): extend routing capabilities to payout operation (#3531)
Co-authored-by: Kashif <mohammed.kashif@juspay.in>
This commit is contained in:
		@ -947,11 +947,22 @@ pub async fn create_payment_connector(
 | 
			
		||||
        status: connector_status,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    let mut default_routing_config =
 | 
			
		||||
        routing_helpers::get_merchant_default_config(&*state.store, merchant_id).await?;
 | 
			
		||||
    let transaction_type = match req.connector_type {
 | 
			
		||||
        #[cfg(feature = "payouts")]
 | 
			
		||||
        api_enums::ConnectorType::PayoutProcessor => api_enums::TransactionType::Payout,
 | 
			
		||||
        _ => api_enums::TransactionType::Payment,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    let mut default_routing_config_for_profile =
 | 
			
		||||
        routing_helpers::get_merchant_default_config(&*state.clone().store, &profile_id).await?;
 | 
			
		||||
    let mut default_routing_config =
 | 
			
		||||
        routing_helpers::get_merchant_default_config(&*state.store, merchant_id, &transaction_type)
 | 
			
		||||
            .await?;
 | 
			
		||||
 | 
			
		||||
    let mut default_routing_config_for_profile = routing_helpers::get_merchant_default_config(
 | 
			
		||||
        &*state.clone().store,
 | 
			
		||||
        &profile_id,
 | 
			
		||||
        &transaction_type,
 | 
			
		||||
    )
 | 
			
		||||
    .await?;
 | 
			
		||||
 | 
			
		||||
    let mca = state
 | 
			
		||||
        .store
 | 
			
		||||
@ -981,6 +992,7 @@ pub async fn create_payment_connector(
 | 
			
		||||
                &*state.store,
 | 
			
		||||
                merchant_id,
 | 
			
		||||
                default_routing_config.clone(),
 | 
			
		||||
                &transaction_type,
 | 
			
		||||
            )
 | 
			
		||||
            .await?;
 | 
			
		||||
        }
 | 
			
		||||
@ -990,6 +1002,7 @@ pub async fn create_payment_connector(
 | 
			
		||||
                &*state.store,
 | 
			
		||||
                &profile_id.clone(),
 | 
			
		||||
                default_routing_config_for_profile.clone(),
 | 
			
		||||
                &transaction_type,
 | 
			
		||||
            )
 | 
			
		||||
            .await?;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user