mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 01:57:45 +08:00 
			
		
		
		
	refactor(merchant_id): create domain type for merchant_id (#5408)
				
					
				
			Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
		| @ -125,7 +125,7 @@ pub async fn create_link_token( | ||||
|                 pi.billing_address_id.clone(), | ||||
|                 &key_store, | ||||
|                 &pi.payment_id, | ||||
|                 &merchant_account.merchant_id, | ||||
|                 merchant_account.get_id(), | ||||
|                 merchant_account.storage_scheme, | ||||
|             ) | ||||
|             .await | ||||
| @ -140,20 +140,20 @@ pub async fn create_link_token( | ||||
|         .store | ||||
|         .find_by_merchant_connector_account_merchant_id_merchant_connector_id( | ||||
|             &(&state).into(), | ||||
|             merchant_account.merchant_id.as_str(), | ||||
|             merchant_account.get_id(), | ||||
|             &selected_config.mca_id, | ||||
|             &key_store, | ||||
|         ) | ||||
|         .await | ||||
|         .change_context(ApiErrorResponse::MerchantConnectorAccountNotFound { | ||||
|             id: merchant_account.merchant_id.clone(), | ||||
|             id: merchant_account.get_id().get_string_repr().to_owned(), | ||||
|         })?; | ||||
|  | ||||
|     let auth_type = helpers::get_connector_auth_type(merchant_connector_account)?; | ||||
|  | ||||
|     let router_data = pm_auth_types::LinkTokenRouterData { | ||||
|         flow: std::marker::PhantomData, | ||||
|         merchant_id: Some(merchant_account.merchant_id), | ||||
|         merchant_id: Some(merchant_account.get_id().clone()), | ||||
|         connector: Some(connector_name.to_string()), | ||||
|         request: pm_auth_types::LinkTokenRequest { | ||||
|             client_name: "HyperSwitch".to_string(), | ||||
| @ -235,13 +235,13 @@ pub async fn exchange_token_core( | ||||
|         .store | ||||
|         .find_by_merchant_connector_account_merchant_id_merchant_connector_id( | ||||
|             &(&state).into(), | ||||
|             merchant_account.merchant_id.as_str(), | ||||
|             merchant_account.get_id(), | ||||
|             &config.mca_id, | ||||
|             &key_store, | ||||
|         ) | ||||
|         .await | ||||
|         .change_context(ApiErrorResponse::MerchantConnectorAccountNotFound { | ||||
|             id: merchant_account.merchant_id.clone(), | ||||
|             id: merchant_account.get_id().get_string_repr().to_owned(), | ||||
|         })?; | ||||
|  | ||||
|     let auth_type = helpers::get_connector_auth_type(merchant_connector_account.clone())?; | ||||
| @ -297,7 +297,7 @@ async fn store_bank_details_in_payment_methods( | ||||
|         .find_payment_intent_by_payment_id_merchant_id( | ||||
|             &(&state).into(), | ||||
|             &payload.payment_id, | ||||
|             &merchant_account.merchant_id, | ||||
|             merchant_account.get_id(), | ||||
|             &key_store, | ||||
|             merchant_account.storage_scheme, | ||||
|         ) | ||||
| @ -311,7 +311,7 @@ async fn store_bank_details_in_payment_methods( | ||||
|     let payment_methods = db | ||||
|         .find_payment_method_by_customer_id_merchant_id_list( | ||||
|             &customer_id, | ||||
|             &merchant_account.merchant_id, | ||||
|             merchant_account.get_id(), | ||||
|             None, | ||||
|         ) | ||||
|         .await | ||||
| @ -459,7 +459,7 @@ async fn store_bank_details_in_payment_methods( | ||||
|             let now = common_utils::date_time::now(); | ||||
|             let pm_new = storage::PaymentMethodNew { | ||||
|                 customer_id: customer_id.clone(), | ||||
|                 merchant_id: merchant_account.merchant_id.clone(), | ||||
|                 merchant_id: merchant_account.get_id().clone(), | ||||
|                 payment_method_id: pm_id, | ||||
|                 payment_method: Some(enums::PaymentMethod::BankDebit), | ||||
|                 payment_method_type: Some(creds.payment_method_type), | ||||
| @ -555,7 +555,7 @@ pub async fn get_bank_account_creds( | ||||
|  | ||||
|     let router_data_bank_details = pm_auth_types::BankDetailsRouterData { | ||||
|         flow: std::marker::PhantomData, | ||||
|         merchant_id: Some(merchant_account.merchant_id.clone()), | ||||
|         merchant_id: Some(merchant_account.get_id().clone()), | ||||
|         connector: Some(connector_name.to_string()), | ||||
|         request: pm_auth_types::BankAccountCredentialsRequest { | ||||
|             access_token: access_token.clone(), | ||||
| @ -784,7 +784,7 @@ pub async fn retrieve_payment_method_from_auth_service( | ||||
|         payment_intent.billing_address_id.clone(), | ||||
|         key_store, | ||||
|         &payment_intent.payment_id, | ||||
|         &merchant_account.merchant_id, | ||||
|         merchant_account.get_id(), | ||||
|         merchant_account.storage_scheme, | ||||
|     ) | ||||
|     .await?; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Narayan Bhat
					Narayan Bhat