@model Nop.Plugin.Payments.PayPalStandard.Models.ConfigurationModel
@inject Nop.Core.IWebHelper webHelper
@{
    Layout = "_ConfigurePlugin";
}

@await Component.InvokeAsync("StoreScopeConfiguration")

<script>
	$(document).ready(function () {
        $("#@Html.IdFor(model => model.PassProductNamesAndTotals)").click(togglePassProductNamesAndTotals);
	    togglePassProductNamesAndTotals();
	});

    function togglePassProductNamesAndTotals() {
        warningValidation('@Url.Action("RoundingWarning", "PaymentPayPalStandard")', '@Html.NameFor(model => model.PassProductNamesAndTotals)',
            { passProductNamesAndTotals: $('#@Html.IdFor(model => model.PassProductNamesAndTotals)').is(':checked') });
    }
</script>

<form asp-controller="PaymentPayPalStandard" asp-action="Configure" method="post">
    <div class="cards-group">
        <div class="card card-default">
            <div class="card-body">
                @Html.Raw(T("Plugins.Payments.PayPalStandard.Instructions", $"{webHelper.GetStoreLocation()}Plugins/PaymentPayPalStandard/PDTHandler"))
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="UseSandbox_OverrideForStore" asp-input="UseSandbox" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="UseSandbox" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="UseSandbox" />
                        <span asp-validation-for="UseSandbox"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="BusinessEmail_OverrideForStore" asp-input="BusinessEmail" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="BusinessEmail" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="BusinessEmail" />
                        <span asp-validation-for="BusinessEmail"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="PdtToken_OverrideForStore" asp-input="PdtToken" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="PdtToken" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="PdtToken" />
                        <span asp-validation-for="PdtToken"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="PassProductNamesAndTotals_OverrideForStore" asp-input="PassProductNamesAndTotals" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="PassProductNamesAndTotals" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="PassProductNamesAndTotals" />
                        <span asp-validation-for="PassProductNamesAndTotals"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="AdditionalFee_OverrideForStore" asp-input="AdditionalFee" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="AdditionalFee" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="AdditionalFee" />
                        <span asp-validation-for="AdditionalFee"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="AdditionalFeePercentage_OverrideForStore" asp-input="AdditionalFeePercentage" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="AdditionalFeePercentage" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="AdditionalFeePercentage" />
                        <span asp-validation-for="AdditionalFeePercentage"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-9 offset-md-3">
                        <button type="submit" name="save" class="btn btn-primary">@T("Admin.Common.Save")</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>