Exemple #1
0
        private async Task <IActionResult> CreateInvoiceForPaymentRequest(string id,
                                                                          bool redirectToInvoice,
                                                                          ViewPaymentRequestViewModel result,
                                                                          decimal?amount = null)
        {
            var pr = await _PaymentRequestRepository.FindPaymentRequest(id, null);

            var blob  = pr.GetBlob();
            var store = pr.StoreData;

            store.AdditionalClaims.Add(new Claim(Policies.CanCreateInvoice.Key, store.Id));
            try
            {
                var redirectUrl = Request.GetDisplayUrl().TrimEnd("/pay", StringComparison.InvariantCulture)
                                  .Replace("hub?id=", string.Empty, StringComparison.InvariantCultureIgnoreCase);
                var newInvoiceId = (await _InvoiceController.CreateInvoiceCore(new CreateInvoiceRequest()
                {
                    OrderId = $"{PaymentRequestRepository.GetOrderIdForPaymentRequest(id)}",
                    Currency = blob.Currency,
                    Price = amount.GetValueOrDefault(result.AmountDue),
                    FullNotifications = true,
                    BuyerEmail = result.Email,
                    RedirectURL = redirectUrl,
                }, store, HttpContext.Request.GetAbsoluteRoot(), new List <string>()
                {
                    PaymentRequestRepository.GetInternalTag(id)
                })).Data.Id;

                if (redirectToInvoice)
                {
                    return(RedirectToAction("Checkout", "Invoice", new { Id = newInvoiceId }));
                }

                return(Ok(newInvoiceId));
            }
            catch (BitpayHttpException e)
            {
                return(BadRequest(e.Message));
            }
        }
        public async Task <IActionResult> PayPaymentRequest(string payReqId, bool redirectToInvoice = true,
                                                            decimal?amount = null, CancellationToken cancellationToken = default)
        {
            if (amount.HasValue && amount.Value <= 0)
            {
                return(BadRequest("Please provide an amount greater than 0"));
            }

            var result = await _PaymentRequestService.GetPaymentRequest(payReqId, GetUserId());

            if (result == null)
            {
                return(NotFound());
            }

            if (result.Archived)
            {
                if (redirectToInvoice)
                {
                    return(RedirectToAction("ViewPaymentRequest", new { Id = payReqId }));
                }

                return(BadRequest("Payment Request cannot be paid as it has been archived"));
            }

            result.HubPath = PaymentRequestHub.GetHubPath(Request);
            if (result.AmountDue <= 0)
            {
                if (redirectToInvoice)
                {
                    return(RedirectToAction("ViewPaymentRequest", new { Id = payReqId }));
                }

                return(BadRequest("Payment Request has already been settled."));
            }

            if (result.ExpiryDate.HasValue && DateTime.UtcNow >= result.ExpiryDate)
            {
                if (redirectToInvoice)
                {
                    return(RedirectToAction("ViewPaymentRequest", new { Id = payReqId }));
                }

                return(BadRequest("Payment Request has expired"));
            }

            var stateAllowedToDisplay = new HashSet <InvoiceState>
            {
                new InvoiceState(InvoiceStatusLegacy.New, InvoiceExceptionStatus.None),
                new InvoiceState(InvoiceStatusLegacy.New, InvoiceExceptionStatus.PaidPartial),
            };
            var currentInvoice = result
                                 .Invoices
                                 .FirstOrDefault(invoice => stateAllowedToDisplay.Contains(invoice.State));

            if (currentInvoice != null)
            {
                if (redirectToInvoice)
                {
                    return(RedirectToAction("Checkout", "UIInvoice", new { currentInvoice.Id }));
                }

                return(Ok(currentInvoice.Id));
            }

            if (result.AllowCustomPaymentAmounts && amount != null)
            {
                amount = Math.Min(result.AmountDue, amount.Value);
            }
            else
            {
                amount = result.AmountDue;
            }

            var pr = await _PaymentRequestRepository.FindPaymentRequest(payReqId, null, cancellationToken);

            var blob  = pr.GetBlob();
            var store = pr.StoreData;

            try
            {
                var redirectUrl = _linkGenerator.PaymentRequestLink(payReqId, Request.Scheme, Request.Host, Request.PathBase);

                var invoiceMetadata =
                    new InvoiceMetadata
                {
                    OrderId          = PaymentRequestRepository.GetOrderIdForPaymentRequest(payReqId),
                    PaymentRequestId = payReqId,
                    BuyerEmail       = result.Email
                };

                var invoiceRequest =
                    new CreateInvoiceRequest
                {
                    Metadata = invoiceMetadata.ToJObject(),
                    Currency = blob.Currency,
                    Amount   = amount.Value,
                    Checkout = { RedirectURL = redirectUrl }
                };

                var additionalTags = new List <string> {
                    PaymentRequestRepository.GetInternalTag(payReqId)
                };
                var newInvoice = await _InvoiceController.CreateInvoiceCoreRaw(invoiceRequest, store, Request.GetAbsoluteRoot(), additionalTags, cancellationToken);

                if (redirectToInvoice)
                {
                    return(RedirectToAction("Checkout", "UIInvoice", new { newInvoice.Id }));
                }

                return(Ok(newInvoice.Id));
            }
            catch (BitpayHttpException e)
            {
                return(BadRequest(e.Message));
            }
        }
        public async Task <IActionResult> PayPaymentRequest(string id, bool redirectToInvoice = true,
                                                            decimal?amount = null, CancellationToken cancellationToken = default)
        {
            if (amount.HasValue && amount.Value <= 0)
            {
                return(BadRequest("Please provide an amount greater than 0"));
            }
            var result = await _PaymentRequestService.GetPaymentRequest(id, GetUserId());

            if (result == null)
            {
                return(NotFound());
            }
            result.HubPath = PaymentRequestHub.GetHubPath(this.Request);
            if (result.AmountDue <= 0)
            {
                if (redirectToInvoice)
                {
                    return(RedirectToAction("ViewPaymentRequest", new { Id = id }));
                }

                return(BadRequest("Payment Request has already been settled."));
            }

            if (result.ExpiryDate.HasValue && DateTime.Now >= result.ExpiryDate)
            {
                if (redirectToInvoice)
                {
                    return(RedirectToAction("ViewPaymentRequest", new { Id = id }));
                }

                return(BadRequest("Payment Request has expired"));
            }

            var statusesAllowedToDisplay = new List <InvoiceStatus>()
            {
                InvoiceStatus.New
            };
            var validInvoice = result.Invoices.FirstOrDefault(invoice =>
                                                              Enum.TryParse <InvoiceStatus>(invoice.Status, true, out var status) &&
                                                              statusesAllowedToDisplay.Contains(status));

            if (validInvoice != null)
            {
                if (redirectToInvoice)
                {
                    return(RedirectToAction("Checkout", "Invoice", new { Id = validInvoice.Id }));
                }

                return(Ok(validInvoice.Id));
            }

            if (result.AllowCustomPaymentAmounts && amount != null)
            {
                amount = Math.Min(result.AmountDue, amount.Value);
            }
            else
            {
                amount = result.AmountDue;
            }


            var pr = await _PaymentRequestRepository.FindPaymentRequest(id, null);

            var blob  = pr.GetBlob();
            var store = pr.StoreData;

            try
            {
                var redirectUrl = Request.GetDisplayUrl().TrimEnd("/pay", StringComparison.InvariantCulture)
                                  .Replace("hub?id=", string.Empty, StringComparison.InvariantCultureIgnoreCase);
                var newInvoiceId = (await _InvoiceController.CreateInvoiceCore(new CreateInvoiceRequest()
                {
                    OrderId = $"{PaymentRequestRepository.GetOrderIdForPaymentRequest(id)}",
                    Currency = blob.Currency,
                    Price = amount.Value,
                    FullNotifications = true,
                    BuyerEmail = result.Email,
                    RedirectURL = redirectUrl,
                }, store, HttpContext.Request.GetAbsoluteRoot(),
                                                                               new List <string>()
                {
                    PaymentRequestRepository.GetInternalTag(id)
                },
                                                                               cancellationToken: cancellationToken))
                                   .Data.Id;

                if (redirectToInvoice)
                {
                    return(RedirectToAction("Checkout", "Invoice", new { Id = newInvoiceId }));
                }

                return(Ok(newInvoiceId));
            }
            catch (BitpayHttpException e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemple #4
0
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(126, 1, true);
            WriteLiteral("\n");
            EndContext();
#line 4 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"

            Layout = "_Layout";

#line default
#line hidden
            BeginContext(156, 130, true);
            WriteLiteral("\n<section>\n    <div class=\"container\">\n\n        <div class=\"row\">\n            <div class=\"col-lg-12 text-center\">\n                ");
            EndContext();
            BeginContext(286, 52, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "d6a8093e6ece41a0a6b78b85bcc2be1b", async() => {
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_0.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
#line 13 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.StatusMessage);

#line default
#line hidden
            __tagHelperExecutionContext.AddTagHelperAttribute("for", __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(338, 326, true);
            WriteLiteral(@"
            </div>
        </div>

        <div class=""row"">
            <div class=""col-lg-12 text-center"">
                <h2 class=""section-heading"">Payment Requests</h2>
            </div>
        </div>

        <div class=""row no-gutter"" style=""margin-bottom: 5px;"">
            <div class=""col-lg-6"">
                ");
            EndContext();
            BeginContext(664, 164, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "db5539bbc0044bf885c42b548c58dcce", async() => {
                BeginContext(763, 61, true);
                WriteLiteral("<span class=\"fa fa-plus\"></span> Create a new payment request");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_1.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(828, 652, true);
            WriteLiteral(@"
                <a href=""https://docs.btcpayserver.org/features/paymentrequests"" target=""_blank""><span class=""fa fa-question-circle-o"" title=""More information...""></span></a>
            </div>
        </div>

        <div class=""row"">
            <table class=""table table-sm table-responsive-md"">
                <thead>
                <tr>
                    <th>Title</th>
                    <th>Expiry</th>
                    <th class=""text-right"">Price</th>
                    <th class=""text-right"">Status</th>
                    <th class=""text-right"">Actions</th>
                </tr>
                </thead>
                <tbody>
");
            EndContext();
#line 42 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            foreach (var item in Model.Items)
            {
#line default
#line hidden
                BeginContext(1549, 53, true);
                WriteLiteral("                    <tr>\n                        <td>");
                EndContext();
                BeginContext(1603, 10, false);
#line 45 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.Title);

#line default
#line hidden
                EndContext();
                BeginContext(1613, 34, true);
                WriteLiteral("</td>\n                        <td>");
                EndContext();
                BeginContext(1649, 45, false);
#line 46 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.ExpiryDate?.ToString("g") ?? "No Expiry");

#line default
#line hidden
                EndContext();
                BeginContext(1695, 53, true);
                WriteLiteral("</td>\n                        <td class=\"text-right\">");
                EndContext();
                BeginContext(1749, 11, false);
#line 47 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.Amount);

#line default
#line hidden
                EndContext();
                BeginContext(1760, 1, true);
                WriteLiteral(" ");
                EndContext();
                BeginContext(1762, 13, false);
#line 47 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.Currency);

#line default
#line hidden
                EndContext();
                BeginContext(1775, 53, true);
                WriteLiteral("</td>\n                        <td class=\"text-right\">");
                EndContext();
                BeginContext(1829, 11, false);
#line 48 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.Status);

#line default
#line hidden
                EndContext();
                BeginContext(1840, 82, true);
                WriteLiteral("</td>\n                        <td class=\"text-right\">\n                            ");
                EndContext();
                BeginContext(1922, 67, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "1b346b61719c45c3bb0e46e067c2cbbd", async() => {
                    BeginContext(1981, 4, true);
                    WriteLiteral("Edit");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 50 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(1989, 74, true);
                WriteLiteral("\n                            <span> - </span>\n                            ");
                EndContext();
                BeginContext(2063, 67, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "145764e2fa3e4334b25279d5c736b21c", async() => {
                    BeginContext(2122, 4, true);
                    WriteLiteral("View");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_5.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 52 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2130, 74, true);
                WriteLiteral("\n                            <span> - </span>\n                            ");
                EndContext();
                BeginContext(2204, 183, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "abb6207cd6884acd9d5f00bc93151c40", async() => {
                    BeginContext(2375, 8, true);
                    WriteLiteral("Invoices");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_7.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_7);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_8.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_8);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-searchterm", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 54 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral($"orderid:{PaymentRequestRepository.GetOrderIdForPaymentRequest(item.Id)}");

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["searchterm"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-searchterm", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["searchterm"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2387, 74, true);
                WriteLiteral("\n                            <span> - </span>\n                            ");
                EndContext();
                BeginContext(2461, 81, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "c8c054bee43e418bb2eb443003d7667d", async() => {
                    BeginContext(2535, 3, true);
                    WriteLiteral("Pay");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_9.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_9);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 56 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2542, 74, true);
                WriteLiteral("\n                            <span> - </span>\n                            ");
                EndContext();
                BeginContext(2616, 85, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "31383935c1a94441a46d5768bf5730ee", async() => {
                    BeginContext(2692, 5, true);
                    WriteLiteral("Clone");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_10.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_10);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 58 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2701, 74, true);
                WriteLiteral("\n                            <span> - </span>\n                            ");
                EndContext();
                BeginContext(2775, 77, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "b07c3bb412d441fa8c0bfa07c8f22a81", async() => {
                    BeginContext(2842, 6, true);
                    WriteLiteral("Remove");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_11.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_11);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 60 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2852, 57, true);
                WriteLiteral("\n                        </td>\n                    </tr>\n");
                EndContext();
#line 63 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            }

#line default
#line hidden
            BeginContext(2927, 157, true);
            WriteLiteral("                </tbody>\n            </table>\n            \n            <nav aria-label=\"...\">\n                <ul class=\"pagination\">\n                    <li");
            EndContext();
            BeginWriteAttribute("class", " class=\"", 3084, "\"", 3141, 2);
            WriteAttributeValue("", 3092, "page-item", 3092, 9, true);
#line 69 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            WriteAttributeValue("  ", 3101, Model.Skip == 0 ? "disabled" : null, 3103, 38, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(3142, 60, true);
            WriteLiteral(">\n                        <a class=\"page-link\" tabindex=\"-1\"");
            EndContext();
            BeginWriteAttribute("href", " href=\"", 3202, "\"", 3586, 1);
#line 70 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            WriteAttributeValue("", 3209, Url.Action("GetPaymentRequests", new
            {
                skip  = Math.Max(0, Model.Skip - Model.Count),
                count = Model.Count,
            }), 3209, 377, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(3587, 140, true);
            WriteLiteral(">Previous</a>\n                    </li>\n                    <li class=\"page-item disabled\">\n                        <span class=\"page-link\">");
            EndContext();
            BeginContext(3729, 14, false);
#line 77 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            Write(Model.Skip + 1);

#line default
#line hidden
            EndContext();
            BeginContext(3744, 4, true);
            WriteLiteral(" to ");
            EndContext();
            BeginContext(3750, 24, false);
#line 77 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            Write(Model.Skip + Model.Count);

#line default
#line hidden
            EndContext();
            BeginContext(3775, 4, true);
            WriteLiteral(" of ");
            EndContext();
            BeginContext(3780, 11, false);
#line 77 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            Write(Model.Total);

#line default
#line hidden
            EndContext();
            BeginContext(3791, 57, true);
            WriteLiteral("</span>\n                    </li>\n                    <li");
            EndContext();
            BeginWriteAttribute("class", " class=\"", 3848, "\"", 3929, 2);
            WriteAttributeValue("", 3856, "page-item", 3856, 9, true);
#line 79 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            WriteAttributeValue(" ", 3865, Model.Total > (Model.Skip + Model.Count) ? null : "disabled", 3866, 63, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(3930, 46, true);
            WriteLiteral(">\n                        <a class=\"page-link\"");
            EndContext();
            BeginWriteAttribute("href", " href=\"", 3976, "\"", 4291, 1);
#line 80 "C:\Users\Rolando\Desktop\BTCPAY\btcpayserver-master\btcpayserver-master\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            WriteAttributeValue("", 3983, Url.Action("GetPaymentRequests", new
            {
                skip  = Model.Skip + Model.Count,
                count = Model.Count,
            }), 3983, 308, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(4292, 115, true);
            WriteLiteral(">Next</a>\n                    </li>\n                </ul>\n            </nav>\n        </div>\n\n    </div>\n</section>\n");
            EndContext();
        }
Exemple #5
0
        public async Task CanCancelPaymentWhenPossible()
        {
            using var tester = CreateServerTester();
            await tester.StartAsync();

            var user = tester.NewAccount();

            user.GrantAccess();
            user.RegisterDerivationScheme("BTC");

            var paymentRequestController = user.GetController <UIPaymentRequestController>();

            Assert.IsType <NotFoundResult>(await
                                           paymentRequestController.CancelUnpaidPendingInvoice(Guid.NewGuid().ToString(), false));

            var request = new UpdatePaymentRequestViewModel()
            {
                Title       = "original juice",
                Currency    = "BTC",
                Amount      = 1,
                StoreId     = user.StoreId,
                Description = "description"
            };
            var response = Assert
                           .IsType <RedirectToActionResult>(paymentRequestController.EditPaymentRequest(null, request).Result)
                           .RouteValues.Last();
            var invoiceId = response.Value.ToString();
            await paymentRequestController.PayPaymentRequest(invoiceId, false);

            Assert.IsType <BadRequestObjectResult>(await
                                                   paymentRequestController.CancelUnpaidPendingInvoice(invoiceId, false));

            request.AllowCustomPaymentAmounts = true;

            response = Assert
                       .IsType <RedirectToActionResult>(paymentRequestController.EditPaymentRequest(null, request).Result)
                       .RouteValues.Last();

            var paymentRequestId = response.Value.ToString();

            invoiceId = Assert
                        .IsType <OkObjectResult>(await paymentRequestController.PayPaymentRequest(paymentRequestId, false))
                        .Value
                        .ToString();

            var actionResult = Assert
                               .IsType <RedirectToActionResult>(
                await paymentRequestController.PayPaymentRequest(response.Value.ToString()));

            Assert.Equal("Checkout", actionResult.ActionName);
            Assert.Equal("UIInvoice", actionResult.ControllerName);
            Assert.Contains(actionResult.RouteValues,
                            pair => pair.Key == "Id" && pair.Value.ToString() == invoiceId);

            var invoice = user.BitPay.GetInvoice(invoiceId, Facade.Merchant);

            Assert.Equal(InvoiceState.ToString(InvoiceStatusLegacy.New), invoice.Status);
            Assert.IsType <OkObjectResult>(await
                                           paymentRequestController.CancelUnpaidPendingInvoice(paymentRequestId, false));

            invoice = user.BitPay.GetInvoice(invoiceId, Facade.Merchant);
            Assert.Equal(InvoiceState.ToString(InvoiceStatusLegacy.Invalid), invoice.Status);

            Assert.IsType <BadRequestObjectResult>(await
                                                   paymentRequestController.CancelUnpaidPendingInvoice(paymentRequestId, false));

            invoiceId = Assert
                        .IsType <OkObjectResult>(await paymentRequestController.PayPaymentRequest(paymentRequestId, false))
                        .Value
                        .ToString();

            await user.BitPay.GetInvoiceAsync(invoiceId, Facade.Merchant);

            //a hack to generate invoices for the payment request is to manually create an invoice with an order id that matches:
            user.BitPay.CreateInvoice(new Invoice(1, "USD")
            {
                OrderId = PaymentRequestRepository.GetOrderIdForPaymentRequest(paymentRequestId)
            });
            //shouldn't crash
            await paymentRequestController.ViewPaymentRequest(paymentRequestId);

            await paymentRequestController.CancelUnpaidPendingInvoice(paymentRequestId);
        }
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(128, 2, true);
            WriteLiteral("\r\n");
            EndContext();
#line 4 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"

            Layout = "_Layout";

#line default
#line hidden
            BeginContext(162, 136, true);
            WriteLiteral("\r\n<section>\r\n    <div class=\"container\">\r\n\r\n        <div class=\"row\">\r\n            <div class=\"col-lg-12 text-center\">\r\n                ");
            EndContext();
            BeginContext(298, 52, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "2d20b2038aea4c33b51e7ee98e18a4c0", async() => {
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_0.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
#line 13 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.StatusMessage);

#line default
#line hidden
            __tagHelperExecutionContext.AddTagHelperAttribute("for", __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(350, 341, true);
            WriteLiteral(@"
            </div>
        </div>

        <div class=""row"">
            <div class=""col-lg-12 text-center"">
                <h2 class=""section-heading"">Solicitudes de pago</h2>
            </div>
        </div>

        <div class=""row no-gutter"" style=""margin-bottom: 5px;"">
            <div class=""col-lg-6"">
                ");
            EndContext();
            BeginContext(691, 169, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "95f33ec021a44c68ab4c00f921f93da9", async() => {
                BeginContext(790, 66, true);
                WriteLiteral("<span class=\"fa fa-plus\"></span> Crear una nueva solicitud de pago");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_1.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(860, 675, true);
            WriteLiteral(@"
                <a href=""https://docs.btcpayserver.org/features/paymentrequests"" target=""_blank""><span class=""fa fa-question-circle-o"" title=""Más información...""></span></a>
            </div>
        </div>

        <div class=""row"">
            <table class=""table table-sm table-responsive-md"">
                <thead>
                <tr>
                    <th>Título</th>
                    <th>Expiración</th>
                    <th class=""text-right"">Precio</th>
                    <th class=""text-right"">Estado</th>
                    <th class=""text-right"">Acciones</th>
                </tr>
                </thead>
                <tbody>
");
            EndContext();
#line 42 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            foreach (var item in Model.Items)
            {
#line default
#line hidden
                BeginContext(1606, 54, true);
                WriteLiteral("                    <tr>\r\n                        <td>");
                EndContext();
                BeginContext(1661, 10, false);
#line 45 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.Title);

#line default
#line hidden
                EndContext();
                BeginContext(1671, 35, true);
                WriteLiteral("</td>\r\n                        <td>");
                EndContext();
                BeginContext(1708, 45, false);
#line 46 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.ExpiryDate?.ToString("g") ?? "No Expiry");

#line default
#line hidden
                EndContext();
                BeginContext(1754, 54, true);
                WriteLiteral("</td>\r\n                        <td class=\"text-right\">");
                EndContext();
                BeginContext(1809, 11, false);
#line 47 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.Amount);

#line default
#line hidden
                EndContext();
                BeginContext(1820, 1, true);
                WriteLiteral(" ");
                EndContext();
                BeginContext(1822, 13, false);
#line 47 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.Currency);

#line default
#line hidden
                EndContext();
                BeginContext(1835, 54, true);
                WriteLiteral("</td>\r\n                        <td class=\"text-right\">");
                EndContext();
                BeginContext(1890, 11, false);
#line 48 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                Write(item.Status);

#line default
#line hidden
                EndContext();
                BeginContext(1901, 84, true);
                WriteLiteral("</td>\r\n                        <td class=\"text-right\">\r\n                            ");
                EndContext();
                BeginContext(1985, 67, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "d087531a240e4f49aaa2d23b366a4ee0", async() => {
                    BeginContext(2044, 4, true);
                    WriteLiteral("Edit");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 50 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2052, 76, true);
                WriteLiteral("\r\n                            <span> - </span>\r\n                            ");
                EndContext();
                BeginContext(2128, 67, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "994ed96ea33c49dcac3a298528b8ce04", async() => {
                    BeginContext(2187, 4, true);
                    WriteLiteral("View");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_5.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 52 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2195, 76, true);
                WriteLiteral("\r\n                            <span> - </span>\r\n                            ");
                EndContext();
                BeginContext(2271, 183, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "0d7a79f9b3154a8e9a083c7bdd660fab", async() => {
                    BeginContext(2442, 8, true);
                    WriteLiteral("Facturas");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_7.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_7);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_8.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_8);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-searchterm", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 54 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral($"orderid:{PaymentRequestRepository.GetOrderIdForPaymentRequest(item.Id)}");

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["searchterm"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-searchterm", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["searchterm"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2454, 76, true);
                WriteLiteral("\r\n                            <span> - </span>\r\n                            ");
                EndContext();
                BeginContext(2530, 83, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "7a5a9e438a184843bdebf532c0f9832b", async() => {
                    BeginContext(2604, 5, true);
                    WriteLiteral("Pagar");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_9.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_9);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 56 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2613, 76, true);
                WriteLiteral("\r\n                            <span> - </span>\r\n                            ");
                EndContext();
                BeginContext(2689, 86, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "b29dc9a6b88b45e99eb705f31181b4bf", async() => {
                    BeginContext(2765, 6, true);
                    WriteLiteral("Clonar");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_10.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_10);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 58 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2775, 76, true);
                WriteLiteral("\r\n                            <span> - </span>\r\n                            ");
                EndContext();
                BeginContext(2851, 79, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "4655f63144284a0ea3922d0b8a773072", async() => {
                    BeginContext(2918, 8, true);
                    WriteLiteral("Eliminar");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_11.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_11);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 60 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
                WriteLiteral(item.Id);

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(2930, 60, true);
                WriteLiteral("\r\n                        </td>\r\n                    </tr>\r\n");
                EndContext();
#line 63 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            }

#line default
#line hidden
            BeginContext(3009, 162, true);
            WriteLiteral("                </tbody>\r\n            </table>\r\n            \r\n            <nav aria-label=\"...\">\r\n                <ul class=\"pagination\">\r\n                    <li");
            EndContext();
            BeginWriteAttribute("class", " class=\"", 3171, "\"", 3228, 2);
            WriteAttributeValue("", 3179, "page-item", 3179, 9, true);
#line 69 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            WriteAttributeValue("  ", 3188, Model.Skip == 0 ? "disabled" : null, 3190, 38, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(3229, 61, true);
            WriteLiteral(">\r\n                        <a class=\"page-link\" tabindex=\"-1\"");
            EndContext();
            BeginWriteAttribute("href", " href=\"", 3290, "\"", 3678, 1);
#line 70 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            WriteAttributeValue("", 3297, Url.Action("GetPaymentRequests", new
            {
                skip  = Math.Max(0, Model.Skip - Model.Count),
                count = Model.Count,
            }), 3297, 381, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(3679, 143, true);
            WriteLiteral(">Anterior</a>\r\n                    </li>\r\n                    <li class=\"page-item disabled\">\r\n                        <span class=\"page-link\">");
            EndContext();
            BeginContext(3824, 14, false);
#line 77 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            Write(Model.Skip + 1);

#line default
#line hidden
            EndContext();
            BeginContext(3839, 4, true);
            WriteLiteral(" to ");
            EndContext();
            BeginContext(3845, 24, false);
#line 77 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            Write(Model.Skip + Model.Count);

#line default
#line hidden
            EndContext();
            BeginContext(3870, 4, true);
            WriteLiteral(" of ");
            EndContext();
            BeginContext(3875, 11, false);
#line 77 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            Write(Model.Total);

#line default
#line hidden
            EndContext();
            BeginContext(3886, 59, true);
            WriteLiteral("</span>\r\n                    </li>\r\n                    <li");
            EndContext();
            BeginWriteAttribute("class", " class=\"", 3945, "\"", 4026, 2);
            WriteAttributeValue("", 3953, "page-item", 3953, 9, true);
#line 79 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            WriteAttributeValue(" ", 3962, Model.Total > (Model.Skip + Model.Count) ? null : "disabled", 3963, 63, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(4027, 47, true);
            WriteLiteral(">\r\n                        <a class=\"page-link\"");
            EndContext();
            BeginWriteAttribute("href", " href=\"", 4074, "\"", 4393, 1);
#line 80 "C:\Users\Rolando\Desktop\BTCPAY\banexcoinpay-master-github\banexcoinpay\BTCPayServer\Views\PaymentRequest\GetPaymentRequests.cshtml"
            WriteAttributeValue("", 4081, Url.Action("GetPaymentRequests", new
            {
                skip  = Model.Skip + Model.Count,
                count = Model.Count,
            }), 4081, 312, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(4394, 128, true);
            WriteLiteral(">Siguiente</a>\r\n                    </li>\r\n                </ul>\r\n            </nav>\r\n        </div>\r\n\r\n    </div>\r\n</section>\r\n");
            EndContext();
        }