<p class="invoice-date">
    {{ stripe_event_data['invoice'].date|date("j F Y") }} - 
    {% if stripe_event_data['invoice'].paid == true %}
    paid <i class="icon icon-ok"></i>
    {% else %}
    unpaid
    {% endif %}    
</p>

<table class="table">
    <tbody>
        {% for line in stripe_event_data['invoice'].lines.data %}
        <tr>
            <td>
                {% if line.type == 'subscription' %}
                    Subscription to {{ line.plan.name|lower }} plan {% if line.amount == 0 %}(free trial){% endif %}
                    <br><span>{{ line.period.start|date("j F Y") }} to {{ line.period.end|date("j F Y") }}</span>
                {% endif %}
            </td>
            <td>&pound;{{ (line.amount / 100)|number_format(2) }}</td>
        </tr>            
        {% endfor %}
        <tr>
            <td>Total</td>
            <td>&pound;{{ (stripe_event_data['invoice'].total/100)|number_format(2) }}</td>
        </tr>
    </tbody>
</table>
<p class="invoice-date">
    {{ stripe_event_data['invoice'].date|date("j F Y") }} - 
    {% if stripe_event_data['invoice'].paid == true %}
    paid <i class="icon icon-ok"></i>
    {% else %}
    unpaid
    {% endif %}    
</p>

<table class="table">
    <tbody>
        {% for line in stripe_event_data['invoice'].lines.data %}
        <tr>
            <td>
                {% if line.type == 'subscription' %}
                    Subscription to {{ line.plan.name|lower }} plan {% if line.amount == 0 %}(free trial){% endif %}
                    <br><span>{{ line.period.start|date("j F Y") }} to {{ line.period.end|date("j F Y") }}</span>
                {% endif %}
            </td>
            <td>&pound;{{ (line.amount / 100)|number_format(2) }}</td>
        </tr>            
        {% endfor %}
        <tr>
            <td>Total</td>
            <td>&pound;{{ (stripe_event_data['invoice'].total/100)|number_format(2) }}</td>
        </tr>
    </tbody>
</table>

{% if stripe_event_data['invoice'].attempt_count == 0 %}
<p>    
    We haven't tried to take payment for this invoice yet. We will try
    in about {{ stripe_event_data['invoice'].next_payment_attempt_relative }}.
</p>
{% else %}
{% endif %}


Add payment attempt count and next payment attempt relative date to latest invoice (for zero attempts currently)
Add payment attempt count and next payment attempt relative date to latest invoice (for zero attempts currently)
