mirror of
https://github.com/anikeen-com/id.git
synced 2026-11-04 22:59:41 +00:00
Start subscriptions with a free trial
trial_days, trial_ends_at and trial_once when creating subscriptions (app and user token) and per subscription of checkout sessions. isTrial() on subscriptions, the subscription.trial_will_end event type, and the trial_already_used error code in the docs.
This commit is contained in:
10 files changed
+130
-9
No files matched your search
@@ -48,6 +48,14 @@ trait HasSubscriptionStatus
|
||||
return in_array($this->status(), [SubscriptionStatus::TRIAL, SubscriptionStatus::ACTIVE, SubscriptionStatus::PAUSED, SubscriptionStatus::CANCELLING], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* In its free trial: running, nothing billed until trial_ends_at.
|
||||
*/
|
||||
public function isTrial(): bool
|
||||
{
|
||||
return $this->status() === SubscriptionStatus::TRIAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paused: runs until the paid period ends, then expires (resume() to continue).
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user