<section>
    <!-- loader -->
            
    <div class="TrustPayLoader">
        <div class="loaderContent">
            <img src="{$shop_url}modules/trustpay/views/img/loader.gif" style="width:160px; height:120px; max-height: none;" alt=""/>
        </div>
    </div>

    <!-- loader end -->
    
    {if $disable_popup == 0}
    	<script type="text/javascript">
    		var prestashop_version = '17';
        	var trustpay_iframe_ibt = '{$tpibt_url nofilter}';

    		setTimeout(function(){
    			var tp_ibt = $('#trustpay_iframe_ibt').parent().parent().attr('id').match(/\d+/)[0];
    			allowed_popup.push(tp_ibt);
    		}, 500);
    	</script>

    	<iframe id="trustpay_iframe_ibt" allow="payment" src="#"></iframe>
    	<a href="#" class="trustpay_iframe_ibt">Pay via finby</a>
    {/if}
    <p class="trustpay-logos trustpay-top-ident">
        <img src="{$shop_url}modules/trustpay/views/img/logo/finby_text_black.png" alt="">
    </p>
    
    {if $disable_popup == 0}
    <script>

        function getRedirectBw() {
            {if $view_type == 'redirect'}
                    
                if(trustpay_iframe_ibt.indexOf('&IsRedirect=true') > -1) {
                    trustpay_iframe_ibt = trustpay_iframe_ibt.substr(0, trustpay_iframe_ibt.indexOf('&IsRedirect=true')) + trustpay_iframe_ibt.substr(trustpay_iframe_ibt.indexOf('&IsRedirect=true') + 16);
                }
                if(trustpay_iframe_ibt.indexOf('&IsRedirect=false') > -1) {
                    trustpay_iframe_ibt = trustpay_iframe_ibt.substr(0, trustpay_iframe_ibt.indexOf('&IsRedirect=false')) + trustpay_iframe_ibt.substr(trustpay_iframe_ibt.indexOf('&IsRedirect=false') + 17);
                }
            
                trustpay_iframe_ibt += '&IsRedirect=true';
                
                $('input[data-module-name="truspay_bw"]').click(function(event){
                    $("#payment-confirmation").find('button[type="submit"]').click(function(event){
                        event.preventDefault();
                        window.location.href=trustpay_iframe_ibt;
                    });
                });
            {/if}
            
        }
        
        if(window.addEventListener){
            window.addEventListener('load', getRedirectBw);
        }else{
            window.attachEvent('onload', getRedirectBw);
        }
        
    </script>
    
    {/if}

    <p class="trustpay-last">
        {l s='Pay in your domestic bank by finby gateway or by finby internal transfers.' mod='trustpay'}
    </p>
    {if $TRUSTPAY_LOGOS_BANK == 1}
        <div class="trustpay-logos-105">
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/slsp.svg" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/vub.svg" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/csob.svg" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/tb.svg" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/pb.svg" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
            
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/N26.svg" style="width:70px;" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/Revolut.svg" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/fio.svg" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/raiff.svg" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
            
            <p class="trustpay-logo-wapper"><img src="{$shop_url}modules/trustpay/views/img/logo/ib.svg" alt="{l s='Logo: Domestic banks' mod='trustpay'}" /></p>
        </div>
    {/if}

</section>
