| 123456789101112131415161718192021 |
- <?php
-
- namespace App\Billing;
-
- /**
- * What the payment provider says about one subscription, in a shape that does not depend on the provider.
- */
- final readonly class SubscriptionState
- {
- public function __construct(
- public string $subscriptionId,
- public string $customerId,
- /** The provider's word for the state: active, past_due, canceled and so on. */
- public string $status,
- /** The provider's id of the price being paid, which tells us the plan. */
- public ?string $priceId,
- /** Unix time when the paid-for period ends. */
- public ?int $currentPeriodEnd,
- public bool $cancelAtPeriodEnd,
- ) {}
- }
|