Make sure the invoiceEvent is from a payment request.

This commit is contained in:
nicolas.dorier 2019-02-25 16:01:39 +09:00
parent d818baa6d1
commit 5bccd07d7d
2 changed files with 3 additions and 4 deletions

View file

@ -116,9 +116,9 @@ namespace BTCPayServer.PaymentRequest
{
if (evt is InvoiceEvent invoiceEvent)
{
var paymentRequestId =
PaymentRequestRepository.GetPaymentRequestIdFromOrderId(invoiceEvent.Invoice.OrderId);
var paymentRequestId = PaymentRequestRepository.GetPaymentRequestIdFromOrderId(invoiceEvent.Invoice.OrderId);
if (paymentRequestId == null)
return;
if (invoiceEvent.Name == InvoiceEvent.ReceivedPayment)
{
await _PaymentRequestService.UpdatePaymentRequestStateIfNeeded(paymentRequestId);

View file

@ -35,7 +35,6 @@ namespace BTCPayServer.PaymentRequest
public async Task UpdatePaymentRequestStateIfNeeded(string id)
{
var pr = await _PaymentRequestRepository.FindPaymentRequest(id, null);
await UpdatePaymentRequestStateIfNeeded(pr);
}