{% set oHeidelPaySettings = oHeidelpayViewConfig.getSettings() %}
{% set oHeidelPayment = oHeidelPaySettings.getPayment(paymentmethod) %}
{% set aBrands = oHeidelpayViewConfig.getHeidelpayNgwBrands(paymentmethod, oHeidelPayment, oxcmp_user) %}
{% set sImageUrl = oViewConf.getModuleUrl('d3unzer', 'out/img/') %}

{% block heidelpay_cards %}
    <div class="well well-sm">
        <dl>
            <dt>
                <input id="payment_{{ sPaymentID }}"
                       type="radio"
                       name="paymentid"
                       value="{{ sPaymentID }}"
                       {% if oView.getCheckedPaymentId() == paymentmethod.oxpayments__oxid.value %}checked{% endif %}>
                <label for="payment_{{ sPaymentID }}">
                    <b>{{ paymentmethod.oxpayments__oxdesc.value }}</b>
                    {% for sBrandIdent, sBrandName in aBrands %}
                        {% set sBrandIdent = sBrandIdent|lower %}
                        {% set sFullImageUrl = sImageUrl ~ 'logo_' ~ sBrandIdent ~ '.jpg' %}
                        {% include "@d3unzer/generic/payment_img.html.twig" with {sImageUrl: sFullImageUrl, sBrandIdent: sBrandIdent} %}
                    {% endfor %}
                </label>
            </dt>

            <dd class="payment-option {% if oView.getCheckedPaymentId() == paymentmethod.oxpayments__oxid.value %}activePayment{% endif %}">
                {% set oPaymentPrice = paymentmethod.getPrice() %}
                {% if oPaymentPrice.getPrice() %}
                    {% if oViewConf.isFunctionalityEnabled('blShowVATForPayCharge') %}
                        ({{ format_price(oPaymentPrice.getNettoPrice(), { currency: currency }) }}
                        {% if oPaymentPrice.getVatValue() > 0 %}
                            {{ translate({ ident: "PLUS_VAT" }) }} {{ format_price(oPaymentPrice.getVatValue(), { currency: currency }) }}
                        {% endif %})
                    {% else %}
                        ({{ format_price(oPaymentPrice.getBruttoPrice(), { currency: currency }) }})
                    {% endif %}
                {% endif %}
                <div class="row">
                    <div class="col-xs-12 col-lg-9 offset-lg-3">
                        <div class="alert alert-danger">{{ translate({ ident: "D3PAYMENT_EXT_AFTERSTEP4_INFO_STEP4" }) }}</div>
                    </div>
                </div>

                {% block checkout_payment_longdesc %}
                    {% if paymentmethod.oxpayments__oxlongdesc.value %}
                        <div class="row">
                            <div class="col-xs-12 col-lg-9 offset-lg-3">
                                <div class="alert alert-info desc">
                                    {{ paymentmethod.oxpayments__oxlongdesc.getRawValue() }}
                                </div>
                            </div>
                        </div>
                    {% endif %}
                {% endblock %}
            </dd>
        </dl>
    </div>
{% endblock %}
