fix(locker): remove delete_locker_payment_method_by_lookup_key from payments_operation_core (#1636)

This commit is contained in:
Shankar Singh C
2023-07-11 14:38:23 +05:30
committed by GitHub
parent b043ce6130
commit b326c18f45

View File

@ -28,10 +28,7 @@ use self::{
use super::errors::StorageErrorExt; use super::errors::StorageErrorExt;
use crate::{ use crate::{
configs::settings::PaymentMethodTypeTokenFilter, configs::settings::PaymentMethodTypeTokenFilter,
core::{ core::errors::{self, CustomResult, RouterResponse, RouterResult},
errors::{self, CustomResult, RouterResponse, RouterResult},
payment_methods::vault,
},
db::StorageInterface, db::StorageInterface,
logger, logger,
routes::{metrics, AppState}, routes::{metrics, AppState},
@ -198,11 +195,6 @@ where
.await? .await?
} }
}; };
if should_delete_pm_from_locker(payment_data.payment_intent.status) {
vault::Vault::delete_locker_payment_method_by_lookup_key(state, &payment_data.token)
.await
}
} else { } else {
(_, payment_data) = operation (_, payment_data) = operation
.to_update_tracker()? .to_update_tracker()?
@ -1188,13 +1180,6 @@ pub fn should_call_connector<Op: Debug, F: Clone>(
} }
} }
pub fn should_delete_pm_from_locker(status: storage_enums::IntentStatus) -> bool {
!matches!(
status,
storage_models::enums::IntentStatus::RequiresCustomerAction
)
}
pub fn is_operation_confirm<Op: Debug>(operation: &Op) -> bool { pub fn is_operation_confirm<Op: Debug>(operation: &Op) -> bool {
matches!(format!("{operation:?}").as_str(), "PaymentConfirm") matches!(format!("{operation:?}").as_str(), "PaymentConfirm")
} }