{% import "@SyliusShop/Common/Macro/money.html.twig" as money %}

{% set state = order.paymentState %}

{% if state != 'cart' %}
    {% include "@SyliusShop/Common/Order/Label/PaymentState/orderPaymentState.html.twig" %}
    <hr>
{% endif %}

{% for payment in order.payments %}
    {% set state = payment.state %}

    <div class="payment-method card">
        <header class="card-header" id="sylius-payment-method" {{ sylius_test_html_attribute('payment-method') }}>
            {{ payment.method }}
        </header>

        <div class="card-body">
            <p class="card-text" {{ sylius_test_html_attribute('payment-price') }}>
                {{ money.format(payment.amount, payment.currencyCode) }}

                {% if state != 'cart' %}
                    <span id="payment-status" {{ sylius_test_html_attribute('payment-state') }}>
                        {% include "@SyliusShop/Common/Order/Label/PaymentState/singlePaymentState.html.twig" with { 'state': state } %}
                    </span>
                {% endif %}
            </p>
        </div>
    </div>
{% endfor %}
