<?php

namespace Database\Seeders;

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

class PaymentGatewaySeeder extends Seeder
{
    public function run(): void
    {
        $gateways = [
            [
                'name' => 'Stripe',
                'code' => 'stripe',
                'description' => 'Accept credit cards globally via Stripe.',
                'is_global' => true,
                'allowed_countries' => [],
                'supported_currencies' => ['USD', 'EUR', 'GBP'],
                'test_credentials' => ['public_key' => '', 'secret_key' => ''],
                'live_credentials' => ['public_key' => '', 'secret_key' => ''],
            ],
            [
                'name' => 'PayPal',
                'code' => 'paypal',
                'description' => 'Accept payments via PayPal accounts.',
                'is_global' => true,
                'allowed_countries' => [],
                'supported_currencies' => ['USD', 'EUR'],
                'test_credentials' => ['client_id' => '', 'client_secret' => ''],
                'live_credentials' => ['client_id' => '', 'client_secret' => ''],
            ],
            // FIXED TO BANGLADESH & BDT
            [
                'name' => 'SSLCommerz',
                'code' => 'sslcommerz',
                'description' => 'Local cards and mobile banking for Bangladesh.',
                'is_global' => false,
                'allowed_countries' => ['BD'], // Restricted to Bangladesh
                'supported_currencies' => ['BDT'], // Restricted to BDT
                'test_credentials' => ['store_id' => '', 'store_password' => ''],
                'live_credentials' => ['store_id' => '', 'store_password' => ''],
            ]
        ];

        foreach ($gateways as $gateway) {
            PaymentGateway::updateOrCreate(['code' => $gateway['code']], $gateway);
        }
    }
}