Document first_period on subscription.renewed and login-free billing portal links

- subscription.renewed is now sent for the first paid period too;
  data.period.first_period tells it apart (README, EventType, test payload).
- Billing portal links need no login, are single use and valid for about
  15 minutes: create them on click and redirect right away (README,
  createBillingPortalLinkForUser(), appBillingPortalUrl()).
This commit is contained in:
Maurice Preuß committed 2026-11-04 21:57:49 +01:00
1 parent 35ca9ddd2b
commit 7f16155701
6 files changed
+71 -33

No files matched your search

+5 -4
View File
@@ -69,10 +69,11 @@ trait ManagesSubscriptions
}
/**
* A short-lived link to the user's billing pages on Anikeen ID, created with the app's own
* token (trusted apps only, scope subscriptions:client or orders:client), e.g. for a "Manage
* billing" button; see AnikeenId::createBillingPortalLinkForUser() for the attributes
* (return_url, group, flow). Create it when the user clicks, it expires after about 15 minutes.
* A link to the user's billing pages on Anikeen ID that needs no login, created with the app's
* own token (trusted apps only, scope subscriptions:client or orders:client), e.g. for a
* "Manage billing" button; see AnikeenId::createBillingPortalLinkForUser() for the attributes
* (return_url, group, flow). Single use and valid for about 15 minutes: create it when the
* user clicks and redirect right away.
*
* @param array{return_url?: null|string, group?: null|string, flow?: null|string} $attributes
*