Skip to main content

NativeSubscriptionManager

\Benecaster\Membership\NativeSubscriptionManager

Class Premium

Orchestrates subscription provisioning for the NativeBridge: creates subscription rows, mints tokens via the activation cascade, and handles the shared logic used by both ManualSubscriberController and NativeBridge::create_manual_membership().

Methods

Method Visibility Since Description
create_manual( int $user_id, int $show_id, string $tier_slug, ?string $expiry_at ): array Public Provisions a manual-grant subscription: creates a subscription row, triggers the token activation cascade, stamps is_manual_grant = 1 via TokenRepository::set_manual_grant(). Returns { subscription_id: int, token_prefix: string }. Throws \RuntimeException when the manager was constructed without a TokenRepository (third constructor parameter).

Notes

The third constructor parameter ?TokenRepository $tokens = null was added in feature/manual-subscriber-assignment and is nullable for backwards compatibility — existing 2-arg callers still compile. Pass a TokenRepository whenever create_manual() may be called.