{% sw_extends '@Storefront/storefront/component/payment/payment-method.html.twig' %}

{% block component_payment_method_description %}
    {{ parent() }}

    {# Check if the payment method handler belongs to WhitelabelMachineName #}
    {% if payment.handlerIdentifier == 'VRPaymentPayment\\Core\\Checkout\\PaymentHandler\\VRPaymentPaymentHandler' %}
        {# Retrieve the runtime-attached configuration from the extension #}
        {% set vrpConfig = payment.extensions.vrpayment_config %}

        {% if vrpConfig %}
            {% set paymentMethodConfigurationId = vrpConfig.paymentMethodConfigurationId %}

            {# Include the iframe container template #}
            {% sw_include '@VRPaymentPayment/storefront/component/payment/vrpayment_iframe.html.twig' with {
                'paymentMethodConfigurationId': paymentMethodConfigurationId
            } %}
        {% endif %}
    {% endif %}
{% endblock %}
