<?php

namespace Database\Seeders;

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

class PaymentGatewaySeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $gateways = [
            ['name' => 'Monnify', 'slug' => 'monnify', 'priority' => 1],
            ['name' => 'Paystack', 'slug' => 'paystack', 'priority' => 2],
            ['name' => 'Flutterwave', 'slug' => 'flutterwave', 'priority' => 3],
            ['name' => 'Stripe', 'slug' => 'stripe', 'priority' => 4],
        ];

        foreach ($gateways as $gateway) {
            PaymentGateway::updateOrCreate(
                ['slug' => $gateway['slug']],
                $gateway + [
                    'status' => PaymentGateway::STATUS_INACTIVE,
                    'public_key' => null,
                    'secret_key' => null,
                    'webhook_secret' => null,
                    'settings' => [
                        'note' => 'Prepared for future integration. No live payment connection is active.',
                    ],
                    'is_test_mode' => true,
                    'priority' => $gateway['priority'],
                ]
            );
        }
    }
}
