ildar-shaymukhametov_grandnode-refactorings/Grand.Web/Views/Checkout/OpcPaymentMethods.cshtml
@model CheckoutPaymentMethodModel
@await Component.InvokeAsync("Widget", new { widgetZone = "op_checkout_payment_method_top" })
<div class="payment-method">
    @if (Model.DisplayRewardPoints && Model.PaymentMethods.Any())
    {
        <div class="use-reward-points">

            <label class="custom-control custom-checkbox">
                <input asp-for="UseRewardPoints" class="custom-control-input" />
                <span class="custom-control-label"></span>
                <span class="custom-control-description">@string.Format(T("Checkout.UseRewardPoints").Text, Model.RewardPointsBalance, Model.RewardPointsAmount)</span>
            </label>

            @if (Model.RewardPointsEnoughToPayForOrder)
            {
                <script asp-location="Footer">
                        $(document).ready(function() {
                            PaymentMethod.toggleUseRewardPoints($('#@Html.IdFor(model => model.UseRewardPoints)'));
                        });
                </script>
            }
        </div>
    }
    @if (Model.PaymentMethods.Any())
    {
        <div class="list-inline col-12 mt-2 mb-2 px-0" id="payment-method-block">
            @for (int i = 0; i < Model.PaymentMethods.Count; i++)
            {
                var paymentMethod = Model.PaymentMethods[i];
                var paymentMethodName = paymentMethod.Name;
                if (!String.IsNullOrEmpty(paymentMethod.Fee))
                {
                    paymentMethodName = T("Checkout.SelectPaymentMethod.MethodAndFee", paymentMethodName, paymentMethod.Fee).Text;
                }

                <div class="col-12 method-name px-0">
                    <label class="custom-control custom-radio flex-row">
                        <input id="paymentmethod_@(i)" type="radio" name="paymentmethod" value="@(paymentMethod.PaymentMethodSystemName)" checked="@paymentMethod.Selected" class="custom-control-input">
                        <span class="custom-control-label"></span>

                        @if (!String.IsNullOrEmpty(paymentMethod.LogoUrl))
                        {
                            <img src="@paymentMethod.LogoUrl" alt="@paymentMethodName" />
                        }
                        @if (!string.IsNullOrEmpty(paymentMethod.Description))
                        {
                            <span class="custom-control-description pl-1">
                                @paymentMethod.Description
                                @if (!String.IsNullOrEmpty(paymentMethod.Fee))
                                {
                                    <text>(@paymentMethod.Fee)</text>
                                }
                            </span>
                        }
                    </label>
                </div>
            }
        </div>
    }
    else
    {
        <div class="message-error">
            @T("Checkout.NoPaymentMethods")
        </div>
    }
</div>
@await Component.InvokeAsync("Widget", new { widgetZone = "op_checkout_payment_method_bottom" })
