mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Add Back Delete Payment Provider, the db will cascade delete all related recurring payments, related saved cards and client payment provider relation
This commit is contained in:
@@ -101,6 +101,11 @@ if (isset($_GET['delete_payment_provider'])) {
|
||||
|
||||
$provider_id = intval($_GET['delete_payment_provider']);
|
||||
|
||||
// When deleted it cascades deletes
|
||||
// all Recurring paymentes related to payment provider
|
||||
// Delete all Saved Cards related
|
||||
// Delete Client Payment Provider Releation
|
||||
|
||||
$provider_name = sanitizeInput(getFieldById('payment_providers', $provider_id, 'provider_name'));
|
||||
|
||||
// Delete provider
|
||||
|
||||
@@ -42,7 +42,7 @@ if (isset($_GET['delete_saved_payment'])) {
|
||||
|
||||
try {
|
||||
// Initialize stripe
|
||||
require_once 'plugins/stripe-php/init.php';
|
||||
require_once '../plugins/stripe-php/init.php';
|
||||
$stripe = new \Stripe\StripeClient($private_key);
|
||||
|
||||
// Detach PM
|
||||
@@ -56,7 +56,7 @@ if (isset($_GET['delete_saved_payment'])) {
|
||||
|
||||
}
|
||||
|
||||
// Remove payment method from ITFlow
|
||||
// Remove payment method from ITFlow. This will also cascade delete related recurring payments setup
|
||||
mysqli_query($mysqli, "DELETE FROM client_saved_payment_methods WHERE saved_payment_id = $saved_payment_id");
|
||||
|
||||
// SQL Cascade delete will Remove All Associated Auto Payment Methods on recurring invoices in the recurring payments table.
|
||||
|
||||
Reference in New Issue
Block a user