isset($_POST['stripe_enabled']), 'test_mode' => isset($_POST['stripe_test_mode']), 'publishable_key' => trim($_POST['stripe_publishable_key'] ?? ''), 'secret_key' => trim($_POST['stripe_secret_key'] ?? ''), 'webhook_secret' => trim($_POST['stripe_webhook_secret'] ?? '') ]); setFlash('success', 'Stripe settings updated'); } if ($section === 'methods') { setSetting('payment_methods', [ 'card' => isset($_POST['method_card']), 'cash' => isset($_POST['method_cash']), 'wallet' => isset($_POST['method_wallet']), 'gift_card' => isset($_POST['method_gift_card']) ]); setFlash('success', 'Payment methods updated'); } header('Location: /admin/payments.php'); exit; } $stripe = getSetting('payment_stripe', [ 'enabled' => true, 'test_mode' => true, 'publishable_key' => '', 'secret_key' => '', 'webhook_secret' => '' ]); $methods = getSetting('payment_methods', [ 'card' => true, 'cash' => true, 'wallet' => true, 'gift_card' => true ]); ?>