mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-24 14:50:50 +01:00
wip
This commit is contained in:
parent
2cbbf4af7e
commit
a1c86e011a
2 changed files with 11 additions and 6 deletions
|
@ -3,7 +3,7 @@
|
||||||
public class PairSuccessResult
|
public class PairSuccessResult
|
||||||
{
|
{
|
||||||
public string Key { get; set; }
|
public string Key { get; set; }
|
||||||
public string StoreId { get; set; }
|
public string? StoreId { get; set; }
|
||||||
public string UserId { get; set; }
|
public string UserId { get; set; }
|
||||||
|
|
||||||
public string? ExistingWallet { get; set; }
|
public string? ExistingWallet { get; set; }
|
||||||
|
|
|
@ -43,11 +43,16 @@ public class BtcPayAppController : Controller
|
||||||
return Unauthorized();
|
return Unauthorized();
|
||||||
}
|
}
|
||||||
|
|
||||||
var store = await _storeRepository.FindStore(res.StoreId, res.UserId);
|
StoreData? store = null;
|
||||||
|
if (res.StoreId is not null)
|
||||||
|
{
|
||||||
|
store = await _storeRepository.FindStore(res.StoreId, res.UserId);
|
||||||
if (store is null)
|
if (store is null)
|
||||||
{
|
{
|
||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var key = new APIKeyData()
|
var key = new APIKeyData()
|
||||||
{
|
{
|
||||||
|
@ -60,7 +65,7 @@ public class BtcPayAppController : Controller
|
||||||
await _apiKeyRepository.CreateKey(key);
|
await _apiKeyRepository.CreateKey(key);
|
||||||
|
|
||||||
|
|
||||||
var onchain = store.GetDerivationSchemeSettings(_btcPayNetworkProvider, "BTC");
|
var onchain = store?.GetDerivationSchemeSettings(_btcPayNetworkProvider, "BTC");
|
||||||
string? onchainSeed = null;
|
string? onchainSeed = null;
|
||||||
if (onchain is not null)
|
if (onchain is not null)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +76,7 @@ public class BtcPayAppController : Controller
|
||||||
return Ok(new PairSuccessResult()
|
return Ok(new PairSuccessResult()
|
||||||
{
|
{
|
||||||
Key = key.Id,
|
Key = key.Id,
|
||||||
StoreId = store.Id,
|
StoreId = store?.Id,
|
||||||
UserId = res.UserId,
|
UserId = res.UserId,
|
||||||
ExistingWallet =
|
ExistingWallet =
|
||||||
onchain?.AccountDerivation?.GetExtPubKeys()?.FirstOrDefault()
|
onchain?.AccountDerivation?.GetExtPubKeys()?.FirstOrDefault()
|
||||||
|
|
Loading…
Add table
Reference in a new issue