Modify the checkout widget to support subscriptions. Add usage-based billing toggle to sharing settings.

This commit is contained in:
2026-09-30 19:26:21 +02:00
parent 4b9434ce0a
commit 7b2e4b4240
25 changed files with 1060 additions and 684 deletions

View File

@@ -8,24 +8,21 @@ import Euro from "util/Euro.svelte";
{#if $user !== null}
<div class="page_content">
<section>
{#if $user.subscription.type === "patreon"}
{#if $user.subscription.id !== ""}
<p>
You already have a Patreon subscription active. You cannot use
Prepaid while that subscription is active.
You already have the {$user.subscription.name} plan active.
Your account balance is <Euro
amount={$user.balance_micro_eur}/>. Subscriptions are
charged from this balance every day, use the form below to
top it up or to switch to another plan.
</p>
{:else if $user.subscription.type === "prepaid"}
<p>
You already have a Prepaid subscription active. Your account
balance is <Euro amount={$user.balance_micro_eur}/>. Use
the form below to top up your balance.
</p>
<Checkout/>
{:else}
<p>
Pick one of the subscription plans above to upgrade your
account to premium.
Pick a subscription plan to upgrade your account. Your
account balance is <Euro amount={$user.balance_micro_eur}/>.
</p>
{/if}
<Checkout/>
</section>
</div>
{:else}