No need for a sql delete on recurring payments when deleting a saved payment method as SQL cascadely deletes the recurring payment if saved payment method is deleted

This commit is contained in:
johnnyq 2025-07-08 14:10:27 -04:00
parent 93f4ea51fd
commit 307d9892b2
1 changed files with 1 additions and 2 deletions

View File

@ -58,8 +58,7 @@ if (isset($_GET['delete_saved_payment'])) {
// Remove payment method from ITFlow
mysqli_query($mysqli, "DELETE FROM client_saved_payment_methods WHERE saved_payment_id = $saved_payment_id");
// Remove All Associted Auto Payment Methods on recurring invoices
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_saved_payment_id = $saved_payment_id");
// SQL Cascade delete will Remove All Associated Auto Payment Methods on recurring invoices in the recurring payments table.
// Logging & Redirect
logAction("Payment Provider", "Update", "$session_name deleted saved payment method $saved_payment_description (PM: $payment_method)", $client_id);