mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-04 14:07:18 +08:00 
			
		
		
		
	feat: encryption service integration to support batch encryption and decryption (#5164)
Co-authored-by: dracarys18 <karthikey.hegde@juspay.in> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		@ -17,10 +17,11 @@ pub async fn rust_locker_migration(
 | 
			
		||||
    merchant_id: &str,
 | 
			
		||||
) -> CustomResult<services::ApplicationResponse<MigrateCardResponse>, errors::ApiErrorResponse> {
 | 
			
		||||
    let db = state.store.as_ref();
 | 
			
		||||
 | 
			
		||||
    let key_manager_state = &(&state).into();
 | 
			
		||||
    let key_store = state
 | 
			
		||||
        .store
 | 
			
		||||
        .get_merchant_key_store_by_merchant_id(
 | 
			
		||||
            key_manager_state,
 | 
			
		||||
            merchant_id,
 | 
			
		||||
            &state.store.get_master_key().to_vec().into(),
 | 
			
		||||
        )
 | 
			
		||||
@ -28,13 +29,13 @@ pub async fn rust_locker_migration(
 | 
			
		||||
        .change_context(errors::ApiErrorResponse::InternalServerError)?;
 | 
			
		||||
 | 
			
		||||
    let merchant_account = db
 | 
			
		||||
        .find_merchant_account_by_merchant_id(merchant_id, &key_store)
 | 
			
		||||
        .find_merchant_account_by_merchant_id(key_manager_state, merchant_id, &key_store)
 | 
			
		||||
        .await
 | 
			
		||||
        .to_not_found_response(errors::ApiErrorResponse::MerchantAccountNotFound)
 | 
			
		||||
        .change_context(errors::ApiErrorResponse::InternalServerError)?;
 | 
			
		||||
 | 
			
		||||
    let domain_customers = db
 | 
			
		||||
        .list_customers_by_merchant_id(merchant_id, &key_store)
 | 
			
		||||
        .list_customers_by_merchant_id(key_manager_state, merchant_id, &key_store)
 | 
			
		||||
        .await
 | 
			
		||||
        .change_context(errors::ApiErrorResponse::InternalServerError)?;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user