Can't pair same SIN to different store

This commit is contained in:
nicolas.dorier
2017-10-13 18:06:46 +09:00
parent 15e73e1cad
commit a7e10c0fb9
4 changed files with 55 additions and 14 deletions

View File

@@ -57,8 +57,10 @@ namespace BTCPayServer.Controllers
pairingEntity = await _TokenRepository.GetPairingAsync(request.PairingCode);
pairingEntity.SIN = sin;
if(!await _TokenRepository.PairWithSINAsync(request.PairingCode, sin))
throw new BitpayHttpException(400, "Unknown pairing code");
var result = await _TokenRepository.PairWithSINAsync(request.PairingCode, sin);
if(result != PairingResult.Complete && result != PairingResult.Partial)
throw new BitpayHttpException(400, $"Error while pairing ({result})");
}