<?php

namespace Database\Seeders;

use App\Models\Setting;
use Illuminate\Database\Seeder;

class PaymentGatewaySeeder extends Seeder
{
    public function run(): void
    {
        $settings = [
            // ── Stripe ────────────────────────────────────────────────────
            ['key'=>'stripe_label',        'value'=>'Stripe',      'group'=>'payment','type'=>'text',    'label'=>'Stripe Display Label',     'description'=>'Label shown to customers on checkout.'],
            ['key'=>'stripe_environment',  'value'=>'sandbox',     'group'=>'payment','type'=>'select',  'label'=>'Stripe Environment',        'description'=>'Use sandbox for testing, live for real payments.'],

            // ── PayPal ────────────────────────────────────────────────────
            ['key'=>'paypal_label',        'value'=>'PayPal',      'group'=>'payment','type'=>'text',    'label'=>'PayPal Display Label',      'description'=>'Label shown to customers on checkout.'],

            // ── Razorpay ─────────────────────────────────────────────────
            ['key'=>'razorpay_enabled',    'value'=>'0',           'group'=>'payment','type'=>'boolean', 'label'=>'Enable Razorpay',           'description'=>'Accept payments via Razorpay.'],
            ['key'=>'razorpay_label',      'value'=>'Razorpay',    'group'=>'payment','type'=>'text',    'label'=>'Razorpay Display Label',    'description'=>'Label shown to customers on checkout.'],
            ['key'=>'razorpay_environment','value'=>'sandbox',     'group'=>'payment','type'=>'select',  'label'=>'Razorpay Environment',      'description'=>'Use sandbox for testing, live for real payments.'],
            ['key'=>'razorpay_key_id',     'value'=>'',            'group'=>'payment','type'=>'text',    'label'=>'Razorpay Key ID',           'description'=>'Your Razorpay API Key ID.'],
            ['key'=>'razorpay_key_secret', 'value'=>'',            'group'=>'payment','type'=>'password','label'=>'Razorpay Key Secret',       'description'=>'Your Razorpay API Key Secret.'],

            // ── Cashfree ─────────────────────────────────────────────────
            ['key'=>'cashfree_enabled',    'value'=>'0',           'group'=>'payment','type'=>'boolean', 'label'=>'Enable Cashfree',           'description'=>'Accept payments via Cashfree.'],
            ['key'=>'cashfree_label',      'value'=>'Cashfree',    'group'=>'payment','type'=>'text',    'label'=>'Cashfree Display Label',    'description'=>'Label shown to customers on checkout.'],
            ['key'=>'cashfree_environment','value'=>'sandbox',     'group'=>'payment','type'=>'select',  'label'=>'Cashfree Environment',      'description'=>'Use sandbox for testing, live for real payments.'],
            ['key'=>'cashfree_app_id',     'value'=>'',            'group'=>'payment','type'=>'text',    'label'=>'Cashfree App ID',           'description'=>'Your Cashfree App ID from the dashboard.'],
            ['key'=>'cashfree_secret_key', 'value'=>'',            'group'=>'payment','type'=>'password','label'=>'Cashfree Secret Key',       'description'=>'Your Cashfree Secret Key from the dashboard.'],
        ];

        foreach ($settings as $s) {
            Setting::updateOrCreate(['key' => $s['key']], $s);
        }
    }
}
