Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

6.9 KB
Raw Blame
@model PaymentTransactionModel
@{
    //page title
    ViewBag.Title = Loc["Admin.Orders.PaymentTransaction.Details"];
    var area = ViewContext.RouteData.Values["area"]?.ToString();
}
<form asp-area="@area" asp-controller="PaymentTransaction" asp-action="Edit" method="post">

    @* the order screen's shell: every payment operation the transaction allows is an outline
       button that asks first; there is nothing to save, so no primary action, and Delete is in
       the overflow menu *@
    <admin-page sticky
                title="@Loc["Admin.Orders.PaymentTransaction.Details"]"
                icon="bi-truck"
                meta="@Model.PaymentMethodSystemName"
                back-url="@Url.Action("List")"
                back-text="@Loc["Admin.Orders.PaymentTransaction.BackToList"]">
        <page-actions>
            @if (Model.CanCapture)
            {
                <input type="submit" name="capturepaymenttransaction" asp-action="CapturePaymentTransaction" value="@Loc["Admin.PaymentTransaction.Fields.Capture"]"
                       id="capturepaymenttransaction" class="btn btn-outline-secondary" data-grand-confirm="@Loc["Admin.Common.AreYouSure"]"/>
            }
            @if (Model.CanMarkAsPaid)
            {
                <button type="submit" id="markpaymenttransactionaspaid" name="markpaymenttransactionaspaid" asp-action="MarkPaymentTransactionAsPaid" data-grand-confirm="@Loc["Admin.Common.AreYouSure"]" class="btn btn-outline-secondary">
                    <i class="bi bi-cash" aria-hidden="true"></i> @Loc["Admin.PaymentTransaction.Fields.MarkAsPaid"]
                </button>
            }
            @if (Model.CanPartiallyPaidOffline)
            {
                <a id="partiallypaidpaymenttransactionoffline" name="partiallypaidpaymenttransactionoffline"
                   href="@(Url.Action("PartiallyPaidPopup", "PaymentTransaction", new { id = Model.Id, online = false, btnId = "btnRefreshPage", formId = "order-form", area = area }))"
                   class="btn btn-outline-secondary">
                    @Loc["Admin.PaymentTransaction.Fields.PartialPaidOffline"]
                </a>
            }
            @if (Model.CanRefund)
            {
                <input type="submit" name="refundpaymenttransaction" asp-action="RefundPaymentTransaction" value="@Loc["Admin.PaymentTransaction.Fields.Refund"]" id="refundpaymenttransaction"
                       class="btn btn-outline-secondary" data-grand-confirm="@Loc["Admin.Common.AreYouSure"]"/>
            }
            @if (Model.CanRefundOffline)
            {
                <input type="submit" name="refundpaymenttransactionoffline" asp-action="RefundPaymentTransactionOffline" value="@Loc["Admin.PaymentTransaction.Fields.RefundOffline"]"
                       id="refundpaymenttransactionoffline" class="btn btn-outline-secondary" data-grand-confirm="@Loc["Admin.Common.AreYouSure"]"/>
            }
            @if (Model.CanPartiallyRefund)
            {
                <a id="partiallyrefundpaymenttransaction" name="partiallyrefundpaymenttransaction"
                   value="@Loc["Admin.PaymentTransaction.Fields.PartialRefund"]"
                   href="@(Url.Action("PartiallyRefundPopup", "PaymentTransaction", new { id = Model.Id, online = true, btnId = "btnRefreshPage", formId = "order-form", area = area }))"
                   class="btn btn-outline-secondary">
                    @Loc["Admin.PaymentTransaction.Fields.PartialRefund"]
                </a>
            }
            @if (Model.CanPartiallyRefundOffline)
            {
                <a id="partiallyrefundpaymenttransactionoffline" name="partiallyrefundpaymenttransactionoffline"
                   href="@(Url.Action("PartiallyRefundPopup", "PaymentTransaction", new { id = Model.Id, online = false, btnId = "btnRefreshPage", formId = "order-form", area = area }))"
                   class="btn btn-outline-secondary">
                    @Loc["Admin.PaymentTransaction.Fields.PartialRefundOffline"]
                </a>
            }
            @if (Model.CanVoid)
            {
                <input type="submit" name="voidpaymenttransaction" asp-action="VoidPaymentTransaction"
                       value="@Loc["Admin.Orders.Fields.Void"]" id="voidpaymenttransaction" class="btn btn-outline-secondary" data-grand-confirm="@Loc["Admin.Common.AreYouSure"]"/>
            }
            @if (Model.CanVoidOffline)
            {
                <input type="submit" name="voidpaymenttransactionoffline" asp-action="VoidPaymentTransactionOffline"
                       value="@Loc["Admin.PaymentTransaction.Fields.VoidOffline"]" id="voidpaymenttransactionoffline" class="btn btn-outline-secondary" data-grand-confirm="@Loc["Admin.Common.AreYouSure"]"/>
            }
            <admin-action-menu>
                <admin-action id="paymenttransaction-delete" destructive="true" icon="bi-trash"
                              text="@Loc["Admin.Common.Delete"]"/>
            </admin-action-menu>
            <partial name="Partials/WidgetZone.DetailsButtons" model="Model"/>
        </page-actions>

        <partial name="Partials/Update" model="Model"/>
    </admin-page>
    <script>
        $(document).ready(function () {
            $('#partiallypaidpaymenttransactionoffline').magnificPopup({
                type: 'ajax',
                settings: { cache: false, async: false },
                midClick: true,
                callbacks: {
                    parseAjax: function (mfpResponse) {
                        mfpResponse.data = $('<div></div>').html(mfpResponse.data);
                    },
                    ajaxContentAdded: function () {
                        $('.mfp-wrap').removeAttr('tabindex');
                    }
                }
            });
            $('#partiallyrefundpaymenttransaction').magnificPopup({
                type: 'ajax',
                settings: { cache: false, async: false },
                midClick: true,
                callbacks: {
                    parseAjax: function (mfpResponse) {
                        mfpResponse.data = $('<div></div>').html(mfpResponse.data);
                    },
                    ajaxContentAdded: function () {
                        $('.mfp-wrap').removeAttr('tabindex');
                    }
                }
            });
            $('#partiallyrefundpaymenttransactionoffline').magnificPopup({
                type: 'ajax',
                settings: { cache: false, async: false },
                midClick: true,
                callbacks: {
                    parseAjax: function (mfpResponse) {
                        mfpResponse.data = $('<div></div>').html(mfpResponse.data);
                    },
                    ajaxContentAdded: function () {
                        $('.mfp-wrap').removeAttr('tabindex');
                    }
                }
            });
        });
    </script>
</form>
<admin-delete-confirmation button-id="paymenttransaction-delete"/>