fix: use encrypt api for all encryption and decryption (#5379)

This commit is contained in:
Arjun Karthik
2024-07-19 21:03:17 +05:30
committed by GitHub
parent 5861c5a63b
commit 83849a5f3c
17 changed files with 117 additions and 96 deletions

View File

@ -45,7 +45,7 @@ use crate::{
services::{pm_auth as pm_auth_services, ApplicationResponse},
types::{
self,
domain::{self, types::decrypt},
domain::{self, types::decrypt_optional},
storage,
transformers::ForeignTryFrom,
},
@ -327,7 +327,7 @@ async fn store_bank_details_in_payment_methods(
for pm in payment_methods {
if pm.payment_method == Some(enums::PaymentMethod::BankDebit) {
let bank_details_pm_data = decrypt::<serde_json::Value, masking::WithType>(
let bank_details_pm_data = decrypt_optional::<serde_json::Value, masking::WithType>(
&(&state).into(),
pm.payment_method_data.clone(),
Identifier::Merchant(key_store.merchant_id.clone()),