Update how billing is presented for license keys

This commit is contained in:
Owen
2026-09-16 11:05:36 -04:00
parent 1dfe0124be
commit 76a4f50ccf
9 changed files with 170 additions and 39 deletions
@@ -243,6 +243,14 @@ export async function handleSubscriptionCreated(
`License type determined: ${numUsers} users, ${numSites} sites for subscription ${subscription.id}`
);
// Grace period of 5 days added on top of the current billing
// period end (usually ~1 year out) before the license expires
const currentPeriodEnd =
fullSubscription.items.data[0]?.current_period_end;
const expiresAt =
(currentPeriodEnd ?? subscription.created) +
5 * 24 * 60 * 60;
const response = await fetch(
`${privateConfig.getRawPrivateConfig().server.fossorial_api}/api/v1/license-internal/enterprise/paid-for`,
{
@@ -258,7 +266,8 @@ export async function handleSubscriptionCreated(
paidFor: true,
users: numUsers,
sites: numSites,
tier: tier
tier: tier,
expiresAt: expiresAt
})
}
);