mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-01 02:57:02 +08:00 
			
		
		
		
	fix(payment_methods_v2): update fingerprint implementation in v2 (#7270)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -921,6 +921,7 @@ pub async fn create_payment_method( | ||||
|         merchant_account, | ||||
|         key_store, | ||||
|         None, | ||||
|         &customer_id, | ||||
|     ) | ||||
|     .await; | ||||
|  | ||||
| @ -1513,14 +1514,16 @@ pub async fn vault_payment_method( | ||||
|     merchant_account: &domain::MerchantAccount, | ||||
|     key_store: &domain::MerchantKeyStore, | ||||
|     existing_vault_id: Option<domain::VaultId>, | ||||
|     customer_id: &id_type::GlobalCustomerId, | ||||
| ) -> RouterResult<(pm_types::AddVaultResponse, String)> { | ||||
|     let db = &*state.store; | ||||
|  | ||||
|     // get fingerprint_id from vault | ||||
|     let fingerprint_id_from_vault = vault::get_fingerprint_id_from_vault(state, pmd) | ||||
|         .await | ||||
|         .change_context(errors::ApiErrorResponse::InternalServerError) | ||||
|         .attach_printable("Failed to get fingerprint_id from vault")?; | ||||
|     let fingerprint_id_from_vault = | ||||
|         vault::get_fingerprint_id_from_vault(state, pmd, customer_id.get_string_repr().to_owned()) | ||||
|             .await | ||||
|             .change_context(errors::ApiErrorResponse::InternalServerError) | ||||
|             .attach_printable("Failed to get fingerprint_id from vault")?; | ||||
|  | ||||
|     // throw back error if payment method is duplicated | ||||
|     when( | ||||
| @ -1796,6 +1799,7 @@ pub async fn update_payment_method_core( | ||||
|         &merchant_account, | ||||
|         &key_store, | ||||
|         current_vault_id, // using current vault_id for now, will have to refactor this | ||||
|         &payment_method.customer_id, | ||||
|     ) // to generate new one on each vaulting later on | ||||
|     .await | ||||
|     .attach_printable("Failed to add payment method in vault")?; | ||||
|  | ||||
| @ -1257,8 +1257,8 @@ pub async fn get_fingerprint_id_from_vault< | ||||
| >( | ||||
|     state: &routes::SessionState, | ||||
|     data: &D, | ||||
|     key: String, | ||||
| ) -> CustomResult<String, errors::VaultError> { | ||||
|     let key = data.get_vaulting_data_key(); | ||||
|     let data = serde_json::to_string(data) | ||||
|         .change_context(errors::VaultError::RequestEncodingFailed) | ||||
|         .attach_printable("Failed to encode Vaulting data to string")?; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Prasunna Soppa
					Prasunna Soppa