<?php
include '../config/db.php';

if (isset($_GET['id'])) {
    $method_id = $_GET['id'];

    try {
        $stmt = $pdo->prepare("DELETE FROM payment_methods WHERE id = :id");
        $stmt->execute(['id' => $method_id]);
        header("Location: add_payment_method.php?success=Payment method deleted successfully");
    } catch (PDOException $e) {
        die("Error deleting payment method: " . $e->getMessage());
    }
}
?>
