Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

666 B
Raw Blame
<?php

declare(strict_types=1);

namespace App\Jobs\PostHog;

use App\Enums\PostHog\CheckoutEvent;
use App\Models\Account;
use App\Support\StripeSubscriptionConversion;

class TrackCheckoutCompleted extends AbstractTrackStripeEvent
{
    protected function shouldCapture(Account $account): bool
    {
        return filled($account->plan);
    }

    protected function event(): string
    {
        return CheckoutEvent::Completed->value;
    }

    /**
     * @return array<string, mixed>
     */
    protected function properties(Account $account): array
    {
        return StripeSubscriptionConversion::checkoutPropertiesFor($account, $this->payload);
    }
}