From 8631c06731c027b01f43167dead326b0a2d4ace5 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Tue, 27 May 2025 19:29:03 +0100 Subject: [PATCH] Stripe - Remove the locally stored payment identifiers (expiry/last 4) from the database when the client removes the stripe pm --- client/post.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/post.php b/client/post.php index 36009343..03ec1773 100644 --- a/client/post.php +++ b/client/post.php @@ -424,7 +424,7 @@ if (isset($_POST['edit_contact'])) { logAction("Contact", "Edit", "Client contact $session_contact_name edited contact $contact_name in the client portal", $session_client_id, $contact_id); $_SESSION['alert_message'] = "Contact $contact_name updated"; - + header('Location: contacts.php'); customAction('contact_update', $contact_id); @@ -688,7 +688,7 @@ if (isset($_GET['stripe_remove_pm'])) { } // Remove payment method from ITFlow - mysqli_query($mysqli, "UPDATE client_stripe SET stripe_pm = NULL WHERE client_id = $session_client_id LIMIT 1"); + mysqli_query($mysqli, "UPDATE client_stripe SET stripe_pm = NULL, stripe_pm_details = NULL WHERE client_id = $session_client_id LIMIT 1"); // Remove Auto Pay on recurring invoices that are stripe $sql_recurring_invoices = mysqli_query($mysqli, "SELECT recurring_invoice_id FROM recurring_invoices WHERE recurring_invoice_client_id = $session_client_id"); @@ -697,7 +697,7 @@ if (isset($_GET['stripe_remove_pm'])) { $recurring_invoice_id = intval($row['recurring_invoice_id']); mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_method = 'Stripe' AND recurring_payment_recurring_invoice_id = $recurring_invoice_id"); } - + // Logging & Redirect logAction("Stripe", "Update", "$session_contact_name deleted saved Stripe payment method (PM: $payment_method)", $session_client_id, $session_client_id); @@ -749,4 +749,4 @@ if (isset($_POST['delete_recurring_payment'])) { header("Location: " . $_SERVER["HTTP_REFERER"]); -} \ No newline at end of file +}