mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
allow language parameter in pay button endpoint
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using BTCPayServer.Filters;
|
||||
using BTCPayServer.Models;
|
||||
using BTCPayServer.Models.StoreViewModels;
|
||||
@@ -58,7 +59,15 @@ namespace BTCPayServer.Controllers
|
||||
RedirectURL = model.BrowserRedirect,
|
||||
FullNotifications = true
|
||||
}, store, HttpContext.Request.GetAbsoluteRoot(), cancellationToken: cancellationToken);
|
||||
return Redirect(invoice.Data.Url);
|
||||
if (string.IsNullOrEmpty(model.Language))
|
||||
{
|
||||
return Redirect(invoice.Data.Url);
|
||||
}
|
||||
var uriBuilder = new UriBuilder(invoice.Data.Url);
|
||||
var paramValues = HttpUtility.ParseQueryString(uriBuilder.Query);
|
||||
paramValues.Add("lang", model.Language);
|
||||
uriBuilder.Query = paramValues.ToString();
|
||||
return Redirect(uriBuilder.Uri.AbsoluteUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user