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

<div class="payment-method card">
    <header class="card-header" id="sylius-payment-method" {{ sylius_test_html_attribute('payment-method') }}>
        {{ 'app.ui.cart.payment_title'|trans }}
    </header>

    <div class="card-body">
        {% set state = order.paymentState %}
        {% if state != 'cart' %}
            {% include "@SyliusShop/Common/Order/Label/PaymentState/orderPaymentState.html.twig" %}
        {% endif %}

        <table class="table mt-3">
            <tbody>
                {% for payment in order.payments %}
                {% set state = payment.state %}
                    <tr>
                        <td>
                            {% 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 %}
                            {{ payment.method }}
                        </td>
                        <td class="cart-totals-price pr-0">
                            {{ money.format(payment.amount, payment.currencyCode) }}
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>

    </div>
</div>
