Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(payment_methods): skip vault delete for PMs never stored in vault (#14252)
Shankar Singh C8435a33d22c5
diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rsindex 6b2da8dfee..91b67314ca 100644--- a/crates/router/src/core/payment_methods.rs+++ b/crates/router/src/core/payment_methods.rs@@ -7007,10 +7007,12 @@ pub async fn delete_payment_method_by_record(.change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to update payment method in db")?;- vault::delete_payment_method_data_from_vault(state, platform, profile, &payment_method)- .await- .change_context(errors::ApiErrorResponse::InternalServerError)- .attach_printable("Failed to delete payment method from vault")?;+ if payment_method.locker_id.is_some() || payment_method.external_vault_source.is_some() {+ vault::delete_payment_method_data_from_vault(state, platform, profile, &payment_method)+ .await+ .change_context(errors::ApiErrorResponse::InternalServerError)+ .attach_printable("Failed to delete payment method from vault")?;+ }Ok(())}