[{if !$oHeidelpayViewConfig}]
    [{$smarty.block.parent}]
[{else}]
    [{d3modcfgcheck modid="d3heidelpay"}][{/d3modcfgcheck}]
    [{if $mod_d3heidelpay}]
        [{if $oView->d3CheckForMobileTheme() == false}]
        [{* START AZURE *}]
            [{oxscript include="js/widgets/oxpayment.js" priority=10}]
            [{oxscript add="$( '#payment' ).oxPayment();"}]
            [{oxscript include="js/widgets/oxinputvalidator.js" priority=10}]
            [{oxscript add="$('form.js-oxValidate').oxInputValidator();"}]

            [{if $oView->getPaymentList()}]
                <h3 id="paymentHeader" class="blockHead">[{oxmultilang ident="D3HEIDELPAY_PAYMENT_PAGE_PAYMENT"}]</h3>
                [{assign var="inptcounter" value="-1"}]
                <div id="payment">
                    [{foreach key=sPaymentID from=$oView->getPaymentList() item=paymentmethod name=PaymentSelect}]
                        [{assign var="inptcounter" value="`$inptcounter+1`"}]
                        <div onclick="SelectPayment([{$inptcounter}]);">
                            [{include file=$oView->d3GetOpenFormTemplateName($paymentmethod) payment=$paymentmethod}]

                            [{block name="select_payment"}]
                                [{include file=$oView->d3GetPaymentFormTemplateName($paymentmethod)}]
                            [{/block}]

                            [{if $inptcounter > -1}]</form>[{/if}]
                        </div>
                    [{/foreach}]
                </div>
                [{* TRUSTED SHOPS BEGIN *}]
                [{include file="page/checkout/inc/trustedshops.tpl"}]
                [{* TRUSTED SHOPS END *}]

                [{block name="checkout_payment_nextstep"}]
                    [{if $oView->isLowOrderPrice()}]
                        <div class="lineBox clear">
                            <div><b>[{ oxmultilang ident="MIN_ORDER_PRICE" }] [{oxprice price=$oxcmp_basket->getMinOrderPrice() currency=$currency}]</b></div>
                        </div>
                    [{else}]
                        <div class="lineBox clear">
                            <a href="[{oxgetseourl ident=$oViewConf->getOrderLink()}]" class="prevStep submitButton largeButton" id="paymentBackStepBottom">[{ oxmultilang ident="PREVIOUS_STEP" }]</a>
                            <button type="submit" name="userform" class="submitButton nextStep largeButton" id="paymentNextStepBottom">[{ oxmultilang ident="CONTINUE_TO_NEXT_STEP" }]</button>
                        </div>
                    [{/if}]
                [{/block}]

            [{elseif $oView->getEmptyPayment()}]
                [{block name="checkout_payment_nopaymentsfound"}]
                    <div class="lineBlock"></div>
                    <h3 id="paymentHeader" class="blockHead">[{ oxmultilang ident="PAYMENT_INFORMATION" }]</h3>
                    [{oxifcontent ident="oxnopaymentmethod" object="oCont"}]
                    [{$oCont->oxcontents__oxcontent->value}]
                    [{/oxifcontent}]
                    <input type="hidden" name="paymentid" value="oxempty">
                    <div class="lineBox clear">
                        <a href="[{oxgetseourl ident=$oViewConf->getSelfLink()|cat:"cl=user"}]" class="prevStep submitButton largeButton">[{ oxmultilang ident="PREVIOUS_STEP" }]</a>
                        <button type="submit" name="userform" class="submitButton nextStep largeButton" id="paymentNextStepBottom">[{ oxmultilang ident="CONTINUE_TO_NEXT_STEP" }]</button>
                    </div>
                [{/block}]
            [{/if}]
        [{* END AZURE *}]

        [{else}]
        [{* START MOBILE *}]
            <div class="payment-row">
                [{oxscript include="js/widgets/oxinputvalidator.js" priority=10}]
                [{oxscript add="$('form.js-oxValidate').oxInputValidator();"}]
                [{*D3 Disable next part START *}]
                [{*<form action="[{$oViewConf->getSslSelfLink()}]" class="js-oxValidate payment" id="payment" name="order" method="post">
                    <div>
                        [{$oViewConf->getHiddenSid()}]
                        [{$oViewConf->getNavFormParams()}]
                        <input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]" />
                        <input type="hidden" name="fnc" value="validatepayment" />
                    </div>
                    *}]
                [{*D3 Disable next part END *}]

                [{if $oView->getPaymentList()}]
                    [{block name="mb_select_payment_list"}]
                        [{* first loop is to render payment method selection *}]
                        <div id="paymentMethods" class="dropdown">
                            [{* only to track selection within DOM *}]
                            <input type="hidden" id="sPaymentSelected" value="" />
                            <div class="dropdown-toggle" data-toggle="dropdown" data-target="#">
                                <a id="dLabelPaymentSelected" role="button" href="#">
                                    <span id="paymentSelected">[{oxmultilang ident="PAYMENT_METHOD"}]</span>
                                    <i class="glyphicon-chevron-down"></i>
                                </a>
                            </div>
                            <ul class="dropdown-menu" role="menu" aria-labelledby="dLabelPaymentSelected">
                                [{foreach key=sPaymentID from=$oView->getPaymentList() item=paymentmethod name=PaymentSelect}]
                                    [{block name="mb_select_payment_dropdown"}]
                                        [{assign var=sPaymentName value=$paymentmethod->oxpayments__oxdesc->value}]
                                        <li class="dropdown-option">
                                            <a tabindex="-1" data-selection-id="[{$sPaymentID}]">[{$sPaymentName}]</a>
                                        </li>
                                        [{if $oView->getCheckedPaymentId() == $paymentmethod->oxpayments__oxid->value}]
                                            [{oxscript add="$('#sPaymentSelected').val('$sPaymentID');"}]
                                        [{/if}]
                                    [{/block}]
                                [{/foreach}]
                            </ul>
                        </div>
                        <div id="payment">
                            [{foreach key=sPaymentID from=$oView->getPaymentList() item=paymentmethod name=PaymentSelect}]
                                [{block name="mb_select_payment"}]
                                    [{if $sPaymentID == "oxidcashondel"}]
                                        [{include file="page/checkout/inc/payment_oxidcashondel.tpl"}]
                                    [{elseif $sPaymentID == "oxidcreditcard"}]
                                        [{include file="page/checkout/inc/payment_oxidcreditcard.tpl"}]
                                    [{elseif $sPaymentID == "oxiddebitnote"}]
                                        [{include file="page/checkout/inc/payment_oxiddebitnote.tpl"}]
                                    [{else}]
                                        [{include file="page/checkout/inc/payment_other.tpl"}]
                                    [{/if}]
                                [{/block}]
                            [{/foreach}]
                        </div>
                    [{/block}]

                    [{block name="checkout_payment_nextstep"}]
                        <ul class="form">
                            [{if $oView->isLowOrderPrice()}]
                                <li><b>[{oxmultilang ident="MIN_ORDER_PRICE"}] [{$oView->getMinOrderPrice()}] [{$currency->sign}]</b></li>
                            [{else}]
                                <li><input type="submit" id="paymentNextStepBottom" name="userform" class="btn" value="[{oxmultilang ident="CONTINUE_TO_NEXT_STEP"}]" /></li>
                                <li><input type="button" id="paymentBackStepBottom" class="btn previous" value="[{oxmultilang ident="PREVIOUS_STEP"}]" onclick="window.open('[{oxgetseourl ident=$oViewConf->getOrderLink()}]', '_self');" /></li>
                            [{/if}]
                        </ul>
                    [{/block}]

                [{elseif $oView->getEmptyPayment()}]
                    [{block name="checkout_payment_nopaymentsfound"}]
                        <ul class="form">
                            <h3 id="paymentHeader" class="block-head">[{oxmultilang ident="PAYMENT_INFORMATION"}]</h3>
                            [{oxifcontent ident="oxnopaymentmethod" object="oCont"}]
                            [{$oCont->oxcontents__oxcontent->value}]
                            [{/oxifcontent}]
                            <input type="hidden" name="paymentid" value="oxempty" />
                            <li><input type="submit" id="paymentNextStepBottom" name="userform" class="btn" value="[{oxmultilang ident="CONTINUE_TO_NEXT_STEP"}]" /></li>
                            <li><input type="button" id="paymentBackStepBottom" class="btn previous" value="[{oxmultilang ident="PREVIOUS_STEP"}]" onclick="window.open('[{oxgetseourl ident=$oViewConf->getSelfLink()|cat:"cl=user"}]', '_self');" /></li>
                        </ul>
                    [{/block}]
                [{/if}]
            </div>
            [{*D3 disable next line*}]
            [{*</form>*}]
        [{* END MOBILE *}]
        [{/if}]
    [{/if}]
[{/if}]
