<div class="payment-method">
    {% block component_payment_method_field %}
        <div class="payment-form-group form-group">
            {% block component_payment_method_control %}
                <div class="form-check payment-method-radio">
                    {% block component_payment_method_input %}
                        <input type="radio"
                               id="paymentMethod{{ payment.id }}"
                               name="paymentMethodId"
                               value="{{ payment.id }}"
                               {% if payment.id is same as(selectedPaymentMethodId) %}checked="checked"{% endif %}
                               {% if page.isPaymentChangeable is defined and not page.isPaymentChangeable %}
                                   disabled="disabled"
                               {% endif %}
                               class="form-check-input payment-method-input">
                    {% endblock %}

                    {% block component_payment_method_label %}
                        <label class="form-check-label payment-method-label"
                               for="paymentMethod{{ payment.id }}">
                            {% block component_payment_method_image %}
                                {% if payment.media %}
                                    {% sw_thumbnails 'payment-method-image-thumbnails' with {
                                        media: payment.media,
                                        sizes: {
                                            'default': '100px'
                                        },
                                        attributes: {
                                            'class': 'payment-method-image',
                                            'alt': (payment.media.translated.alt ?: payment.translated.name),
                                            'title': (payment.media.translated.title ?: payment.translated.name)
                                        }
                                    } %}
                                {% endif %}
                            {% endblock %}

                            {% block component_payment_method_description %}
                                <div class="payment-method-description">
                                    <strong>{{ payment.translated.name }}</strong>
                                    {% if payment.translated.description %}
                                        {% set paymentDescription = payment.translated.description|raw %}
                                        {% set paymentDescriptionTitle = payment.translated.description|striptags|raw %}

                                        {% if not payment.id is same as(selectedPaymentMethodId) %}
                                            {% set paymentDescription = (paymentDescription|length > 75 ? paymentDescription[:75] ~ ' ...' : paymentDescription) %}
                                        {% endif %}

                                        {% block component_payment_method_description_text %}
                                            <p title="{{ paymentDescriptionTitle }}">{{ paymentDescription }}</p>
                                        {% endblock %}
                                    {% endif %}
                                </div>
                            {% endblock %}
                        </label>
                    {% endblock %}
                </div>
            {% endblock %}
        </div>
    {% endblock %}

    {% block component_payment_fieldset_template %}{% endblock %}
</div>
