[{assign var="dynvalue" value=$oView->D3getDynValueHeidelpay()}]
[{assign var="sImageUrl" value=$oViewConf->getModuleUrl('d3heidelpay','out/img/')}]

[{if $oHeidelpayViewConfig->isPaymentUseInputAfterStep4($paymentmethod->getId())}]
    [{include file="payment_inc_afterstep4_info.tpl"}]
[{elseif $oView->hasUserHPStoreData($paymentmethod->getId())}]
    [{include file="payment_inc_storeduid.tpl"}]
[{else}]
    [{assign var='oHeidelPaySettings' value=$oHeidelpayViewConfig->getSettings()}]
    [{assign var='oHeidelPayment' value=$oHeidelPaySettings->getPayment($paymentmethod)}]
    [{assign var="aBrands" value=$oHeidelpayViewConfig->getHeidelpayNgwBrands($paymentmethod, $oHeidelPayment, $oxcmp_user)}]

    [{oxscript add="jQuery('#$sPaymentID .form select[name=\"ACCOUNT.COUNTRY\"]').on('change', function (e) {
        var valueSelected = this.value;
        var hideableLi    = jQuery('#$sPaymentID .form li').first();

        if (valueSelected == 'DE') {
            hideableLi.hide()
            hideableLi.find('input').prop('disabled', true);
        } else {
            hideableLi.show()
            hideableLi.find('input').prop('disabled', false);
        }
    });"}]

    <dl id="[{$sPaymentID}]">
        <dt>
            <input id="payment_[{$sPaymentID}]"
                   type="radio"
                   name="paymentid"
                   value="[{$sPaymentID}]"
                   [{if $oView->getCheckedPaymentId() == $paymentmethod->oxpayments__oxid->value}]checked[{/if}]>
            <label for="payment_[{$sPaymentID}]"><b>[{$paymentmethod->oxpayments__oxdesc->value}]</b></label>
            <img src="[{$sImageUrl}]logo_elv.jpg" alt="ELV" style="vertical-align: middle;">
        </dt>
        <dd class="[{if $oView->getCheckedPaymentId() == $paymentmethod->oxpayments__oxid->value}]activePayment[{/if}]">
            <ul class="form">
                [{if $oHeidelpayViewConfig->getHeidelpayConfVar('blSepaMode')}]
                    <li>
                        <label>[{oxmultilang ident="D3HEIDELPAY_PAYMENT_INPUT_BANK_BIC"}]</label>
                        <input type="text" class="js-oxValidate js-oxValidate_notEmpty" size="20" maxlength="64" name="ACCOUNT.BIC" value="[{$dynvalue.lsblz}]">
                        <p class="oxValidateError">
                            <span class="js-oxError_notEmpty">[{oxmultilang ident="D3HEIDELPAY_PAYMENT_PAGE_EXCEPTION_INPUT_NOTALLFIELDS"}]</span>
                        </p>
                    </li>
                    <li>
                        <label>[{oxmultilang ident="D3HEIDELPAY_PAYMENT_INPUT_BANK_IBAN"}]</label>
                        <input type="text" class="js-oxValidate js-oxValidate_notEmpty" size="20" maxlength="64" name="ACCOUNT.IBAN" value="[{$dynvalue.lsktonr}]">
                        <p class="oxValidateError">
                            <span class="js-oxError_notEmpty">[{oxmultilang ident="D3HEIDELPAY_PAYMENT_PAGE_EXCEPTION_INPUT_NOTALLFIELDS"}]</span>
                        </p>
                    </li>
                [{else}]
                    <li>
                        <label>[{oxmultilang ident="D3HEIDELPAY_PAYMENT_INPUT_BANK_ROUTINGNUMBER"}]</label>
                        <input type="text"
                               class="js-oxValidate js-oxValidate_notEmpty"
                               size="20"
                               maxlength="64"
                               name="ACCOUNT.BANK"
                               value="[{$dynvalue.lsblz}]">

                        <p class="oxValidateError">
                            <span class="js-oxError_notEmpty">[{oxmultilang ident="D3HEIDELPAY_PAYMENT_PAGE_EXCEPTION_INPUT_NOTALLFIELDS"}]</span>
                        </p>
                    </li>
                    <li>
                        <label>[{oxmultilang ident="D3HEIDELPAY_PAYMENT_INPUT_BANK_ACCOUNTNUMBER"}]</label>
                        <input type="text"
                               class="js-oxValidate js-oxValidate_notEmpty"
                               size="20"
                               maxlength="64"
                               name="ACCOUNT.NUMBER"
                               value="[{$dynvalue.lsktonr}]">

                        <p class="oxValidateError">
                            <span class="js-oxError_notEmpty">[{oxmultilang ident="D3HEIDELPAY_PAYMENT_PAGE_EXCEPTION_INPUT_NOTALLFIELDS"}]</span>
                        </p>
                    </li>
                [{/if}]
                <li>
                    <label>[{oxmultilang ident="D3HEIDELPAY_PAYMENT_INPUT_BANK_ACCOUNTHOLDER"}]</label>
                    <input type="text"
                           class="js-oxValidate js-oxValidate_notEmpty"
                           size="20"
                           maxlength="64"
                           name="ACCOUNT.HOLDER"
                           value="[{if $dynvalue.lsktoinhaber}][{$dynvalue.lsktoinhaber}][{else}][{$oxcmp_user->oxuser__oxfname->value}] [{$oxcmp_user->oxuser__oxlname->value}][{/if}]">

                    <p class="oxValidateError">
                        <span class="js-oxError_notEmpty">[{oxmultilang ident="D3HEIDELPAY_PAYMENT_PAGE_EXCEPTION_INPUT_NOTALLFIELDS"}]</span>
                    </p>
                </li>
                <li>
                    <label>[{oxmultilang ident="D3HEIDELPAY_CC_INPUT_COUNTRY"}]</label>
                    <select id="payment_[{$sPaymentID}]_1" name="ACCOUNT.COUNTRY">
                        <option value="">[{oxmultilang ident="D3PAYMENT_EXT_SELECTPLEASE"}]</option>
                        [{foreach from=$aBrands item='sBrandName' key='sBrandIdent'}]
                            <option value="[{$sBrandIdent}]">[{$sBrandName}]</option>
                        [{/foreach}]
                    </select>
                </li>
            </ul>
            [{if $paymentmethod->oxpayments__oxlongdesc->value}]
                <div class="desc">
                    [{$paymentmethod->oxpayments__oxlongdesc->value}]
                </div>
            [{/if}]
        </dd>
    </dl>
[{/if}]
