{% extends "meta.html" %} {% block title %} Billing - meta.sr.ht {% endblock %} {% block content %}
{% if message %}
{{message}}
{% endif %} {% if current_user.user_type == UserType.active_non_paying %}
You are currently using an unpaid {{cfg("sr.ht", "site-name")}} account. Some site features may be unavailable to your account.
{% elif current_user.user_type == UserType.active_free %}
Your account is exempt from billing. All features are available to you free of charge. You may choose to set up billing if you wish to support the site.
{% elif current_user.user_type == UserType.active_paying %} {% if current_user.payment_cents == 0 %}
Your paid service has been cancelled. At the end of your current term, your account will be downgraded to a free account.
{% else %}
{% if current_user.invoices %} Your account is paid and up-to-date. Your current {{current_user.payment_interval.value}} payment is {{"${:.2f}".format(current_user.payment_cents/100 if current_user.payment_interval.value == "monthly" else current_user.payment_cents*10/100)}}, and was last paid {{current_user.invoices[0].created | date}}. {% else %} Your account is paid and up-to-date. Your current {{current_user.payment_interval.value}} payment is {{"${:.2f}".format(current_user.payment_cents/100 if current_user.payment_interval.value == "monthly" else current_user.payment_cents*10/100)}}. {% endif %}
{% endif %} {% elif current_user.user_type == UserType.active_delinquent %}
Notice: Your payment is past due. Please check that your payment information is correct or your service may be reduced.
{% elif current_user.user_type == UserType.admin %}
Admins are exempt from billing.
{% endif %}
{{paid_pct}}% paid
13.37%
of {{total_users}} registered users
Current number of paid accounts on SourceHut
{% if current_user.user_type == UserType.active_paying and current_user.payment_cents != 0 %}
Change your plan {{icon('caret-right')}}
{{csrf_token()}}
{% elif current_user.user_type == UserType.active_delinquent %}
Change your plan {{icon('caret-right')}}
{{csrf_token()}}
Add payment method {{icon('caret-right')}}
{% elif current_user.user_type == UserType.active_paying and current_user.payment_cents == 0 %}
Renew your account {{icon('caret-right')}}
{% elif current_user.user_type in [ UserType.active_non_paying, UserType.active_free ] %}
Set up billing {{icon('caret-right')}}
{% endif %}
{% if current_user.user_type in [ UserType.active_paying, UserType.active_delinquent ] %}

Payment methods

{% for source in customer.sources %}
{% if source.stripe_id == customer.default_source %}

{{icon('check', cls="text-success")}} Default

{% endif %}

{{source.brand}} ending in {{source.last4}}
Expires {{source.exp_month}}/{{source.exp_year}}

{% endfor %}
Add payment method {{icon('caret-right')}} {% endif %}
{% if len(current_user.invoices) != 0 %}

Invoices

{% for invoice in current_user.invoices %}

{{icon('check')}} ${{"{:.2f}".format(invoice.cents/100)}} with {{invoice.source}} Download PDF

Paid {{invoice.created | date}}
Valid for service until {{invoice.valid_thru | date}} {% if loop.first and current_user.payment_cents != 0 %}
Your account will be automatically renewed at the end of the term. {% endif %}

{% endfor %}
{% endif %}
{% endblock %}