mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-24 06:47: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 string Key { get; set; }
|
||||
public string StoreId { get; set; }
|
||||
public string? StoreId { get; set; }
|
||||
public string UserId { get; set; }
|
||||
|
||||
public string? ExistingWallet { get; set; }
|
||||
|
|
|
@ -43,11 +43,16 @@ public class BtcPayAppController : Controller
|
|||
return Unauthorized();
|
||||
}
|
||||
|
||||
var store = await _storeRepository.FindStore(res.StoreId, res.UserId);
|
||||
if (store is null)
|
||||
StoreData? store = null;
|
||||
if (res.StoreId is not null)
|
||||
{
|
||||
return NotFound();
|
||||
store = await _storeRepository.FindStore(res.StoreId, res.UserId);
|
||||
if (store is null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var key = new APIKeyData()
|
||||
{
|
||||
|
@ -60,7 +65,7 @@ public class BtcPayAppController : Controller
|
|||
await _apiKeyRepository.CreateKey(key);
|
||||
|
||||
|
||||
var onchain = store.GetDerivationSchemeSettings(_btcPayNetworkProvider, "BTC");
|
||||
var onchain = store?.GetDerivationSchemeSettings(_btcPayNetworkProvider, "BTC");
|
||||
string? onchainSeed = null;
|
||||
if (onchain is not null)
|
||||
{
|
||||
|
@ -71,7 +76,7 @@ public class BtcPayAppController : Controller
|
|||
return Ok(new PairSuccessResult()
|
||||
{
|
||||
Key = key.Id,
|
||||
StoreId = store.Id,
|
||||
StoreId = store?.Id,
|
||||
UserId = res.UserId,
|
||||
ExistingWallet =
|
||||
onchain?.AccountDerivation?.GetExtPubKeys()?.FirstOrDefault()
|
||||
|
|
Loading…
Add table
Reference in a new issue