mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
Fix: The checkout page would reload the page when changing payment method
This commit is contained in:
parent
d6e3fb46ee
commit
933dc6be31
2 changed files with 8 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue