{% extends "meta.html" %} {% import "partials/invoice.html" as invoice %} {% set address = user.address %} {% set default_method = user.default_method %} {% set invoices = user.invoices.results %} {% set methods = user.methods %} {% set sub = user.subscription %} {% block title %} Billing - {{cfg("sr.ht", "site-name")}} meta {% endblock %} {% block content %}
{% if message %}
{{message}}
{% endif %} {# Non-paying users are redirected to /billing/initial #} {% if current_user.payment_status == PaymentStatus.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.payment_status == PaymentStatus.SUBSIDIZED %}
Your account has been approved for financial aid. You will receive subsidized services until your financial aid term expires {{current_user.payment_due | date}}, at which point you are encouraged to apply again.
{% elif current_user.payment_status == PaymentStatus.CURRENT %} {% if not sub.autorenew %}
Your renewal payment has been cancelled. When your term expires {{current_user.payment_due | date}}, you will no longer have access to paid features.
{% elif sub.status == SubscriptionStatus.ACTIVE %}
Your account is paid and up-to-date. Your next {% if sub.interval == PaymentInterval.MONTHLY %} monthly {% else %} annual {% endif %} payment of {{sym}}{{"{:.2f}".format(sub.total / 100.0)}} will be automatically charged on {{current_user.payment_due.strftime("%B %d, %Y")}}.
{% if sub.product.retired %}
Notice: Your paid subscription is no longer offered to new customers at your current price. If you cancel your subscription, you will have to pay the new price when you sign up again. If you want to support us (thank you!), you may also voluntarily upgrade your account to one of the new plans. Upgrade my account {{icon('caret-right')}}
{% endif %} {% elif sub.status == SubscriptionStatus.SETTLEMENT %}
Your subscription payment was charged {{sub.updated | date}} and is awaiting settlement, which should take place within the next 7 business days. As a courtesy, paid features are available for your account immediately.
{% endif %} {% elif current_user.payment_status == PaymentStatus.DELINQUENT %}
{{icon('exclamation-circle')}} Important notice

Your most recent {% if sub.interval == PaymentInterval.MONTHLY %} monthly {% else %} annual {% endif %} payment {% if sub["payment"]["error"] %} failed: {{ sub["payment"]["error"] }} {% else %} failed. {% endif %} You have an outstanding balance of {{sym}}{{"{:.2f}".format(sub.total / 100.0)}}. Your access to paid features may be affected as a consequence.

Your payment will be automatically retried over the next few days. You may also consider the following solutions:

{% endif %}
{% if current_user.payment_status == PaymentStatus.CURRENT and sub.status in [SubscriptionStatus.ACTIVE, SubscriptionStatus.SETTLEMENT] and sub.autorenew %}
Change your plan {{icon('caret-right')}}
Cancel your plan {{icon('caret-right')}}
{% elif current_user.payment_status == PaymentStatus.CURRENT and not sub.autorenew %}
Renew your subscription {{icon('caret-right')}}
{% elif current_user.payment_status == PaymentStatus.FREE %}
Set up billing {{icon('caret-right')}}
{% endif %}

Billing address

{% if address %} Edit {{icon('caret-right')}} {% if address.full_name %}{{address.full_name}}
{% endif %} {% if address.business_name %}{{address.business_name}}
{% endif %} {% if address.address_1 %}{{address.address_1}}
{% endif %} {% if address.address_2 %}{{address.address_2}}
{% endif %} {% if address.city %}{{address.city}}
{% endif %} {% if address.region %}{{address.region}}
{% endif %} {% if address.postcode %}{{address.postcode}}
{% endif %} {% if address.country %} {% if address.country.alpha2 == "TW" %} Taiwan
{% else %} {{address.country.name}}
{% endif %} {% endif %} {% if address.vat %}{{address.vat}}
{% endif %} {% else %} We do not have a billing address on file for your account. To include your address or business details on invoices, add a billing address. {% endif %}
{% if methods %}

Payment methods

{% for method in methods %}
{{method.name}} {% if method.expires %}
Expires
{{method.expires.strftime("%m/%Y")}}
{% endif %}
{% if method.id == default_method.id %}
{{icon('check', cls="text-success")}} Default
{% else %}
{{csrf_token()}}
{{csrf_token()}}
{% endif %}
{% endfor %}
Add payment method {{icon('caret-right')}} {% endif %}
{% if len(invoices) != 0 %}

Invoices

{% for i in invoices %} {{ invoice.render(i, CURRENCY_SYMBOLS) }} {% endfor %} View all invoices {{icon('caret-right')}}
{% endif %}
{% endblock %}