feat(addons): finalize event addon catalog and ai styling upgrade flow
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-02-07 12:35:07 +01:00
parent 8cc0918881
commit d2808ffa4f
36 changed files with 1372 additions and 457 deletions

View File

@@ -41,4 +41,27 @@ class PackageAddon extends Model
],
);
}
public function resolvePaypalPrice(): ?float
{
$metadata = is_array($this->metadata) ? $this->metadata : [];
$price = $metadata['price_eur'] ?? null;
return is_numeric($price) ? (float) $price : null;
}
public function isSellableForProvider(?string $provider = null): bool
{
$provider = strtolower((string) ($provider ?? config('package-addons.provider') ?? config('checkout.default_provider', 'paypal')));
if (! $this->active) {
return false;
}
if ($provider === 'lemonsqueezy') {
return filled($this->variant_id);
}
return $this->resolvePaypalPrice() !== null;
}
}