mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
fix issues around local btcpay client and no request obj
This commit is contained in:
parent
451eee549b
commit
b0f00773d6
@ -1,10 +1,12 @@
|
||||
using System.Threading.Tasks;
|
||||
using BTCPayServer.Client;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace BTCPayServer.Abstractions.Contracts
|
||||
{
|
||||
public interface IBTCPayServerClientFactory
|
||||
{
|
||||
Task<BTCPayServerClient> Create(string userId, params string[] storeIds);
|
||||
Task<BTCPayServerClient> Create(string userId, string[] storeIds, HttpContext httpRequest);
|
||||
}
|
||||
}
|
||||
|
@ -118,9 +118,23 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
public async Task<BTCPayServerClient> Create(string userId, params string[] storeIds)
|
||||
public Task<BTCPayServerClient> Create(string userId, params string[] storeIds)
|
||||
{
|
||||
return Create(userId, storeIds, new DefaultHttpContext()
|
||||
{
|
||||
Request =
|
||||
{
|
||||
Scheme = "https",
|
||||
Host = new HostString("dummy.com"),
|
||||
Path = new PathString(),
|
||||
PathBase = new PathString(),
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<BTCPayServerClient> Create(string userId, string[] storeIds, HttpContext context)
|
||||
{
|
||||
var context = new DefaultHttpContext();
|
||||
if (!string.IsNullOrEmpty(userId))
|
||||
{
|
||||
var user = await _userManager.FindByIdAsync(userId);
|
||||
|
Loading…
Reference in New Issue
Block a user