PayButtonHandle(string storeId, [FromForm]PayButtonViewModel model)
- {
- var store = StoreData;
-
- // TODO: extract validation to model
- if (model.Price <= 0)
- ModelState.AddModelError("Price", "Price must be greater than 0");
-
- if (!ModelState.IsValid)
- return View();
-
- var invoice = await _InvoiceController.CreateInvoiceCore(new NBitpayClient.Invoice()
- {
- Price = model.Price,
- Currency = model.Currency,
- ItemDesc = model.CheckoutDesc,
- OrderId = model.OrderId,
- BuyerEmail = model.NotifyEmail,
- NotificationURL = model.ServerIpn,
- RedirectURL = model.BrowserRedirect,
- FullNotifications = true
- }, store, HttpContext.Request.GetAbsoluteRoot());
- return Redirect(invoice.Data.Url);
- }
-
- [HttpGet]
- [Route("{storeId}/paybuttontest")]
- public IActionResult PayButtonTest(string storeId)
- {
- return View();
- }
}
}
diff --git a/BTCPayServer/Views/Stores/PayButtonHandle.cshtml b/BTCPayServer/Views/Public/PayButtonHandle.cshtml
similarity index 100%
rename from BTCPayServer/Views/Stores/PayButtonHandle.cshtml
rename to BTCPayServer/Views/Public/PayButtonHandle.cshtml
diff --git a/BTCPayServer/Views/Stores/PayButtonTest.cshtml b/BTCPayServer/Views/Public/PayButtonTest.cshtml
similarity index 79%
rename from BTCPayServer/Views/Stores/PayButtonTest.cshtml
rename to BTCPayServer/Views/Public/PayButtonTest.cshtml
index c7eb1b307..538e5602b 100644
--- a/BTCPayServer/Views/Stores/PayButtonTest.cshtml
+++ b/BTCPayServer/Views/Public/PayButtonTest.cshtml
@@ -3,7 +3,7 @@