<?php
declare(strict_types=1);

require_once dirname(__DIR__) . '/payments.php';

final class ManualGateway implements PaymentGateway
{
    /** @param array<string,mixed> $settings */
    public function __construct(private array $settings)
    {
    }

    public function providerId(): string
    {
        return 'manual';
    }

    public function createCheckout(array $input): array
    {
        return [
            'external_id' => 'manual_' . bin2hex(random_bytes(8)),
            'checkout_url' => null,
            'status' => 'paid',
            'raw' => ['method' => 'pay_at_shop'],
        ];
    }

    public function fetchStatus(string $externalId): array
    {
        return ['status' => 'paid', 'external_id' => $externalId];
    }
}
