{**
* 2018 Paysera
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
*  @author    Paysera <plugins@paysera.com>
*  @copyright 2018 Paysera
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of Paysera
*}


<div class="row">
    <div class="col-xs-12">
        <div class="paysera-payment-choice-extension">
            {if isset($paymentMethodCountries)}
                <select id="paysera_country" class="payment-country-select">
                    {foreach from=$paymentMethodCountries item=paymentMethodCountry}
                        <option value="{$paymentMethodCountry->getCode()}" {if $paymentMethodCountry->getCode() == $defaultCountry} selected {/if}>{$paymentMethodCountry->getTitle()}</option>
                    {/foreach}
                </select>
                <div style="clear:both"><br/></div>
                {foreach from=$paymentMethodCountries item=paymentMethodCountry}
                    <div
                            id="{$paymentMethodCountry->getCode()}"
                            class="payment-countries paysera-payments {if $isGridView}grid{/if}"
                            style="display: {if $paymentMethodCountry->getCode() == $defaultCountry} block {else} none {/if} ;"
                    >
                        <div class="payment-group-wrapper">
                            {foreach from=$paymentMethodCountry->getGroups() item=paymentMethodGroup}
                                <div class="payment-group-title">{$paymentMethodGroup->getTitle()}</div>
                                {foreach from=$paymentMethodGroup->getPaymentMethods() item=paymentMethod}
                                    <div id="{$paymentMethod->getKey()}" class="payment">
                                        <label>
                                            <input
                                                    class="rd_pay"
                                                    type="radio"
                                                    rel="r{$paymentMethodCountry->getCode()}{$paymentMethod->getKey()}"
                                                    name="payment[pay_type]"
                                                    value="{$paymentMethod->getKey()}"
                                            >
                                            <span class="paysera-text">{$paymentMethod->getTitle()}</span>
                                            <div class="paysera-image">
                                                <img src="{$paymentMethod->getLogoUrl()}" alt="{$paymentMethod->getTitle()}">
                                            </div>
                                        </label>
                                    </div>
                                {/foreach}
                            {/foreach}
                        </div>
                    </div>
                {/foreach}
                {if count($paymentMethodCountries) > 0}
                    <div style="clear:both"><br/></div>
                {/if}
            {elseif $description !== ''}
                {$description}
                <div style="clear:both"><br/></div>
            {/if}

            {if $buyerConsent != null}
                {$buyerConsent.description.partA}
                <a href="{$buyerConsent.link}">{$buyerConsent.rules}</a>
                {$buyerConsent.description.partB}
            {/if}
        </div>
    </div>
</div>
