<?php

namespace Database\Seeders;

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

class PaymentGatewaySeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $gateways = [
            [
                'provider' => 'stripe',
                'enabled' => true,
                'public_key' => env('STRIPE_PUBLIC_KEY', 'pk_test_REPLACEME'),
                'secret_key' => env('STRIPE_SECRET_KEY', 'sk_test_REPLACEME'),
                'webhook_secret' => env('STRIPE_WEBHOOK_SECRET', 'whsec_REPLACEME'),
                'settings' => json_encode([
                    'currency' => 'usd',
                    'capture_method' => 'automatic',
                ]),
            ],
            [
                'provider' => 'paypal',
                'enabled' => false,
                'public_key' => null,
                'secret_key' => null,
                'webhook_secret' => null,
                'settings' => json_encode([
                    'mode' => 'sandbox',
                    'currency' => 'usd',
                ]),
            ],
        ];

        foreach ($gateways as $gateway) {
            PaymentGateway::create($gateway);
        }

        $this->command->info('✓ Payment gateways seeded successfully!');
    }
}
