Create subscription
web.api
Creates a Stripe subscription for the tutor. Supports trial periods.
Handler: SubscriptionService::subscribe()
Get billing portal
auth:api
Returns Stripe Customer Portal URLs for self-service management:
Subscription webhook
StripeService::handleSubscriptionWebhook()
Validates webhook signature using STRIPE_SUBSCRIPTION_SIGNING_SECRET. Updates subscription status in the database.
Subscription statuses
| Status | Meaning |
|---|---|
trialing | In free trial period |
active | Active and paying |
canceled | Cancelled (soft-deleted) |
incomplete | Payment failed, awaiting retry |
incomplete_expired | Payment failed, subscription ended |
Subscription::isValid() — returns true for trialing or active.
Subscription products
Defined insubscription_products table:
| Field | Purpose |
|---|---|
product_id | Stripe product ID |
price_id | Stripe price ID |
trial_period | Trial duration |