{% load i18n %}

<dl class="dl-horizontal">
    <dt>{% trans "Device ID" %}</dt>
    <dd>{{ payment_info.pos_id }}</dd>
    <dt>{% trans "Receipt ID" %}</dt>
    <dd>{{ payment_info.receipt_id }}</dd>
    {% if payment_info.payment_type == "stripe_terminal" %}
        <dt>{% trans "Payment provider" %}</dt>
        <dd>Stripe Terminal</dd>
        <dt>{% trans "ID" %}</dt>
        <dd>{{ payment_info.payment_data.payment_intent }}</dd>
    {% elif payment_info.payment_type == "terminal_zvt" %}
        <dt>{% trans "Payment provider" %}</dt>
        <dd>{% trans "ZVT Terminal" %}</dd>
        {% if payment_info.payment_data.source == "manual" %}
            <dt>{% trans "Confirmation mode" context "terminal_zvt" %}</dt>
            <dd>{{ payment_info.payment_data.source }}</dd>
        {% else %}
            <dt>{% trans "Trace number" context "terminal_zvt" %}</dt>
            <dd>{{ payment_info.payment_data.traceNumber }}</dd>
            <dt>{% trans "Payment type" context "terminal_zvt" %}</dt>
            <dd>{{ payment_info.payment_data.paymentType }}</dd>
            <dt>{% trans "Additional text" context "terminal_zvt" %}</dt>
            <dd>{{ payment_info.payment_data.additionalText }}</dd>
            <dt>{% trans "Turnover number" context "terminal_zvt" %}</dt>
            <dd>{{ payment_info.payment_data.turnoverNumber }}</dd>
            <dt>{% trans "Receipt number" context "terminal_zvt" %}</dt>
            <dd>{{ payment_info.payment_data.receiptNumber }}</dd>
            <dt>{% trans "Card type" context "terminal_zvt" %}</dt>
            <dd>
                {% if payment_info.payment_data.cardName %}
                    {{ payment_info.payment_data.cardName }}
                {% elif payment_info.payment_data.cardType %}
                    {{ payment_info.payment_data.cardType }}
                {% else %}
                    {% trans "Unknown" %}
                {% endif %}
            </dd>
            <dt>{% trans "Card expiration" context "terminal_zvt" %}</dt>
            <dd>{{ payment_info.payment_data.expiry }}</dd>
        {% endif %}
    {% elif payment_info.payment_type == "sumup" %}
        <dt>{% trans "Payment provider" %}</dt>
        <dd>SumUp</dd>
        <dt>{% trans "Transaction Code" %}</dt>
        <dd>{{ payment_info.payment_data.tx_code }}</dd>
        <dt>{% trans "Merchant Code" %}</dt>
        <dd>{{ payment_info.payment_data.merchant_code }}</dd>
        <dt>{% trans "Currency" %}</dt>
        <dd>{{ payment_info.payment_data.currency }}</dd>
        <dt>{% trans "Status" %}</dt>
        <dd>{{ payment_info.payment_data.status }}</dd>
        <dt>{% trans "Type" %}</dt>
        <dd>{{ payment_info.payment_data.type }}</dd>
        <dt>{% trans "Card Entry Mode" %}</dt>
        <dd>{{ payment_info.payment_data.entry_mode }}</dd>
        <dt>{% trans "Card number" %}</dt>
        <dd>
            <i class="fa fa-cc-{{ payment_info.payment_data.card_type|lower }}"></i> **** **** **** {{ payment_info.payment_data.last4 }}
        </dd>
    {% elif payment_info.payment_type == "square_pos" %}
        <dt>{% trans "Payment provider" %}</dt>
        <dd>Square POS</dd>
        <dt>{% trans "Client Transaction Code" %}</dt>
        <dd>{{ payment_info.payment_data.client_transactionId }}</dd>
        {% if payment_info.payment_data.server_transactionId %}
            <dt>{% trans "Server Transaction Code" %}</dt>
            <dd>{{ payment_info.payment_data.server_transactionId }}</dd>
        {% endif %}
    {% elif payment_info.payment_type == "izettle" %}
        <dt>{% trans "Payment provider" %}</dt>
        <dd>Zettle</dd>
        {% if payment_info.payment_data.reference %}
            <dt>{% trans "Payment reference" %}</dt>
            <dd>{{ payment_info.payment_data.reference }}</dd>
        {% endif %}
        <dt>{% trans "Payment Application" %}</dt>
        <dd>{{ payment_info.payment_data.applicationName }}</dd>
        <dt>{% trans "Card Entry Mode" %}</dt>
        <dd>{{ payment_info.payment_data.cardPaymentEntryMode }}</dd>
        <dt>{% trans "Card number" %}</dt>
        <dd>
            <i class="fa fa-cc-{{ payment_info.payment_data.applicationName|lower }}"></i> {{ payment_info.payment_data.maskedPan }}
        </dd>
        <dt>{% trans "Authorization Code" %}</dt>
        <dd>{{ payment_info.payment_data.authorizationCode }}</dd>
    {% elif payment_info.payment_type == "izettle_qrc" %}
        <dt>{% trans "Payment provider" %}</dt>
        <dd>PayPal QRC via Zettle</dd>
        <dt>{% trans "Payment reference" %}</dt>
        <dd>{{ payment_info.payment_data.reference }}</dd>
        <dt>{% trans "Transaction ID" %}</dt>
        <dd>{{ payment_info.payment_data.transactionId }}</dd>
    {% elif payment_info.payment_type == "adyen_legacy" %}
        <dt>{% trans "Payment provider" %}</dt>
        <dd>Adyen POS</dd>
        <dt>{% trans "Reference" %}</dt>
        <dd>{{ payment_info.payment_data.pspReference }}</dd>
        <dt>{% trans "Terminal ID" %}</dt>
        <dd>{{ payment_info.payment_data.terminalId }}</dd>
        <dt>{% trans "Payment method" %}</dt>
        <dd>{{ payment_info.payment_data.paymentMethod }} ({{ payment_info.payment_data.cardType }} / {{ payment_info.payment_data.cardScheme }} / {{ payment_info.payment_data.paymentMethodVariant }})</dd>
        <dt>{% trans "Card holder" %}</dt>
        <dd>{{ payment_info.payment_data.cardHolderName }}</dd>
        <dt>{% trans "Card number" %}</dt>
        <dd>{{ payment_info.payment_data.cardBin }} **** {{ payment_info.payment_data.cardSummary }}</dd>
        <dt>{% trans "Card expiration" %}</dt>
        <dd>{{ payment_info.payment_data.expiryMonth }} / {{ payment_info.payment_data.expiryYear }}</dd>
        <dt>{% trans "Card Entry Mode" %}</dt>
        <dd>{{ payment_info.payment_data.posEntryMode }}</dd>
        <dt>{% trans "Result Code" %}</dt>
        <dd>{{ payment_info.payment_data.posResultCode }}</dd>
    {% elif payment_info.payment_type == "cash" %}
        <dt>{% trans "Payment method" %}</dt>
        <dd>{% trans "Cash" %}</dd>
    {% endif %}
</dl>
