mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-04 05:59:48 +08:00 
			
		
		
		
	refactor: use CountryAlpha2 instead of CountryCode for country codes (#904)
				
					
				
			This commit is contained in:
		@ -1273,7 +1273,7 @@ fn connector_needs_business_sub_label(connector_name: &str) -> bool {
 | 
			
		||||
/// Create the connector label
 | 
			
		||||
/// {connector_name}_{country}_{business_label}
 | 
			
		||||
pub fn get_connector_label(
 | 
			
		||||
    business_country: api_models::enums::CountryCode,
 | 
			
		||||
    business_country: api_models::enums::CountryAlpha2,
 | 
			
		||||
    business_label: &str,
 | 
			
		||||
    business_sub_label: Option<&String>,
 | 
			
		||||
    connector_name: &str,
 | 
			
		||||
@ -1302,10 +1302,10 @@ pub fn get_connector_label(
 | 
			
		||||
/// If there is more than one label or country configured in merchant account, then
 | 
			
		||||
/// passing business details for payment is mandatory to avoid ambiguity
 | 
			
		||||
pub fn get_business_details(
 | 
			
		||||
    business_country: Option<api_enums::CountryCode>,
 | 
			
		||||
    business_country: Option<api_enums::CountryAlpha2>,
 | 
			
		||||
    business_label: Option<&String>,
 | 
			
		||||
    merchant_account: &storage_models::merchant_account::MerchantAccount,
 | 
			
		||||
) -> RouterResult<(api_enums::CountryCode, String)> {
 | 
			
		||||
) -> RouterResult<(api_enums::CountryAlpha2, String)> {
 | 
			
		||||
    let (business_country, business_label) = match business_country.zip(business_label) {
 | 
			
		||||
        Some((business_country, business_label)) => {
 | 
			
		||||
            (business_country.to_owned(), business_label.to_owned())
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user