mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Fix: The checkout page would reload the page when changing payment method
This commit is contained in:
@@ -644,12 +644,14 @@ namespace BTCPayServer.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[Route("i/{invoiceId}/status")]
|
||||
[Route("i/{invoiceId}/{paymentMethodId}/status")]
|
||||
[Route("i/{invoiceId}/{implicitPaymentMethodId}/status")]
|
||||
[Route("invoice/{invoiceId}/status")]
|
||||
[Route("invoice/{invoiceId}/{paymentMethodId}/status")]
|
||||
[Route("invoice/{invoiceId}/{implicitPaymentMethodId}/status")]
|
||||
[Route("invoice/status")]
|
||||
public async Task<IActionResult> GetStatus(string invoiceId, string? paymentMethodId = null, [FromQuery] string? lang = null)
|
||||
public async Task<IActionResult> GetStatus(string invoiceId, string? paymentMethodId = null, string? implicitPaymentMethodId = null, [FromQuery] string? lang = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(paymentMethodId))
|
||||
paymentMethodId = implicitPaymentMethodId;
|
||||
var model = await GetInvoiceModel(invoiceId, paymentMethodId == null ? null : PaymentMethodId.Parse(paymentMethodId), lang);
|
||||
if (model == null)
|
||||
return NotFound();
|
||||
|
||||
@@ -2,7 +2,9 @@ function delegate(eventType, selector, handler, root) {
|
||||
(root || document).addEventListener(eventType, function(event) {
|
||||
const target = event.target.closest(selector);
|
||||
if (target) {
|
||||
handler.call(this, event);
|
||||
if (handler.call(this, event) === false) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user