<?php

namespace App\Services\Webhooks;

class WebhookFactory
{
    /**
     * Create a Standard Webhooks validator for Polar
     */
    public static function createPolar(string $secret): StandardWebhooks
    {
        // Polar uses raw secret, so we use fromRaw() method
        return StandardWebhooks::fromRaw($secret);
    }

    /**
     * Create a Standard Webhooks validator for Stripe
     */
    public static function createStripe(string $secret): StandardWebhooks
    {
        // Stripe typically uses whsec_ prefix
        return new StandardWebhooks($secret);
    }

    /**
     * Create a Standard Webhooks validator for generic providers
     */
    public static function create(string $secret, bool $isRaw = false): StandardWebhooks
    {
        return $isRaw ? StandardWebhooks::fromRaw($secret) : new StandardWebhooks($secret);
    }
}
