{% load i18n %}

{% if payment_info %}
    {% if order.status == "p" %}
        <p>{% blocktrans trimmed %}
            This order has been paid via Stripe.
        {% endblocktrans %}</p>
    {% elif order.status == "r" %}
        <p>{% blocktrans trimmed %}
            This order has been planned to be paid via Stripe and has been marked as refunded.
        {% endblocktrans %}</p>
    {% else %}
        <p>{% blocktrans trimmed %}
            This order has been planned to be paid via Stripe, but the payment has not yet been completed.
        {% endblocktrans %}</p>
    {% endif %}
    {% if order.status == "p" %}
        <dl class="dl-horizontal">
            <dt>{% trans "Charge ID" %}</dt>
            <dd>{{ payment_info.id }}</dd>
            <dt>{% trans "Card type" %}</dt>
            <dd>{{ payment_info.source.brand }}</dd>
            <dt>{% trans "Card number" %}</dt>
            <dd>**** **** **** {{ payment_info.source.last4 }}</dd>
            <dt>{% trans "Payer name" %}</dt>
            <dd>{{ payment_info.source.name }}</dd>
            <dt>{% trans "Total value" %}</dt>
            <dd>{{ payment_info.amount|floatformat:2 }}</dd>
            <dt>{% trans "Currency" %}</dt>
            <dd>{{ payment_info.currency|upper }}</dd>
            <dt>{% trans "Status" %}</dt>
            <dd>{{ payment_info.status }}</dd>
        </dl>
    {% endif %}
    {% if "message" in payment_info %}
        <dl class="dl-horizontal">
            <dt>{% trans "Error message" %}</dt>
            <dd>{{ payment_info.message }}</dd>
        </dl>
    {% endif %}
{% else %}
    <p>{% blocktrans trimmed %}
        This order has been planned to be paid via Stripe, but the payment has not yet been completed.
    {% endblocktrans %}</p>
{% endif %}
