<?php

declare(strict_types=1);

namespace apexl\Io\modules\payment\Dto;

/**
 * Config for initialising a payment gateway adapter.
 *
 * Consumers (Hermes, TC) construct this from their own config / vendor
 * settings + pass to `PaymentGatewayInterface::configure()`. Adapters
 * read the fields they need + ignore the rest.
 *
 * For multi-tenant consumers, build a separate `GatewayConfig` per tenant
 * — adapters MUST be safe to re-`configure()` between requests.
 */
final readonly class GatewayConfig
{
    /**
     * @param array<string, string|int|float|bool|null> $extras
     *   Adapter-specific extension knobs. Stripe might read
     *   `'connect_account_id'`; GoCardless `'creditor_id'`; etc.
     */
    public function __construct(
        public string $apiKey,
        public ?string $apiSecret = null,
        public ?string $webhookSecret = null,
        public bool   $testMode = false,
        public string $defaultCurrency = 'USD',
        public array  $extras = [],
    ) {}
}
