mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	chore: making of function create_encrypted_data (#5251)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -432,13 +432,13 @@ async fn store_bank_details_in_payment_methods( | ||||
|             ); | ||||
|  | ||||
|             let payment_method_data = payment_methods::PaymentMethodsData::BankDetails(pmd); | ||||
|             let encrypted_data = | ||||
|                 cards::create_encrypted_data(&key_store, Some(payment_method_data)) | ||||
|                     .await | ||||
|                     .map(|details| details.into()) | ||||
|                     .ok_or(ApiErrorResponse::InternalServerError)?; | ||||
|             let encrypted_data = cards::create_encrypted_data(&key_store, payment_method_data) | ||||
|                 .await | ||||
|                 .change_context(ApiErrorResponse::InternalServerError) | ||||
|                 .attach_printable("Unable to encrypt customer details")?; | ||||
|  | ||||
|             let pm_update = storage::PaymentMethodUpdate::PaymentMethodDataUpdate { | ||||
|                 payment_method_data: Some(encrypted_data), | ||||
|                 payment_method_data: Some(encrypted_data.into()), | ||||
|             }; | ||||
|  | ||||
|             update_entries.push((pm.clone(), pm_update)); | ||||
| @ -447,8 +447,8 @@ async fn store_bank_details_in_payment_methods( | ||||
|             let encrypted_data = | ||||
|                 cards::create_encrypted_data(&key_store, Some(payment_method_data)) | ||||
|                     .await | ||||
|                     .map(|details| details.into()) | ||||
|                     .ok_or(ApiErrorResponse::InternalServerError)?; | ||||
|                     .change_context(ApiErrorResponse::InternalServerError) | ||||
|                     .attach_printable("Unable to encrypt customer details")?; | ||||
|             let pm_id = generate_id(consts::ID_LENGTH, "pm"); | ||||
|             let now = common_utils::date_time::now(); | ||||
|             let pm_new = storage::PaymentMethodNew { | ||||
| @ -461,7 +461,7 @@ async fn store_bank_details_in_payment_methods( | ||||
|                 payment_method_issuer: None, | ||||
|                 scheme: None, | ||||
|                 metadata: None, | ||||
|                 payment_method_data: Some(encrypted_data), | ||||
|                 payment_method_data: Some(encrypted_data.into()), | ||||
|                 payment_method_issuer_code: None, | ||||
|                 accepted_currency: None, | ||||
|                 token: None, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Prajjwal Kumar
					Prajjwal Kumar