How subscription statuses work in ExtPay
mainExtPay manages subscription lifecycles through the user object returned by extpay.getUser(). Understanding the relationship between user.paid, user.subscriptionStatus, and user.subscriptionCancelAt is critical for implementing access control.
Subscription States
| State | user.paid | user.subscriptionStatus | user.subscriptionCancelAt | Description |
|---|---|---|---|---|
| Active | true | active | null | User has an active, ongoing subscription. |
| Pending Cancellation | true | active | datetime | User has canceled, but access remains until the end of the current billing cycle. |
| Past Due | false | past_due | null | Automatic payment failed. User needs to update payment method. |
| Canceled | false | canceled | datetime | The billing cycle ended and the subscription is no longer active. |
| Unpaid | false | null / other | null | User has not purchased a subscription. |