mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-21 22:11:48 +01:00
Webhooks: Re-add OverPaid property to WebhookInvoiceSettledEvent (#5538)
Fixes #5496.
This commit is contained in:
parent
d050c8e3b2
commit
3f344f2c0c
3 changed files with 5 additions and 2 deletions
|
@ -63,6 +63,7 @@ namespace BTCPayServer.Client.Models
|
|||
}
|
||||
|
||||
public bool ManuallyMarked { get; set; }
|
||||
public bool OverPaid { get; set; }
|
||||
}
|
||||
|
||||
public class WebhookInvoiceInvalidEvent : WebhookInvoiceEvent
|
||||
|
|
|
@ -1984,7 +1984,7 @@ namespace BTCPayServer.Tests
|
|||
Assert.Single(textSearchResult);
|
||||
});
|
||||
|
||||
invoice = user.BitPay.GetInvoice(invoice.Id, Facade.Merchant);
|
||||
invoice = await user.BitPay.GetInvoiceAsync(invoice.Id, Facade.Merchant);
|
||||
Assert.Equal(1000.0m, invoice.TaxIncluded);
|
||||
Assert.Equal(5000.0m, invoice.Price);
|
||||
Assert.Equal(Money.Coins(0), invoice.BtcPaid);
|
||||
|
@ -2104,6 +2104,7 @@ namespace BTCPayServer.Tests
|
|||
c =>
|
||||
{
|
||||
Assert.False(c.ManuallyMarked);
|
||||
Assert.True(c.OverPaid);
|
||||
});
|
||||
user.AssertHasWebhookEvent<WebhookInvoiceProcessingEvent>(WebhookEventType.InvoiceProcessing,
|
||||
c =>
|
||||
|
|
|
@ -72,7 +72,8 @@ public class InvoiceWebhookProvider : WebhookProvider<InvoiceEvent>
|
|||
case InvoiceEventCode.MarkedCompleted:
|
||||
return new WebhookInvoiceSettledEvent(storeId)
|
||||
{
|
||||
ManuallyMarked = eventCode == InvoiceEventCode.MarkedCompleted
|
||||
ManuallyMarked = eventCode == InvoiceEventCode.MarkedCompleted,
|
||||
OverPaid = invoiceEvent.Invoice.ExceptionStatus == InvoiceExceptionStatus.PaidOver
|
||||
};
|
||||
case InvoiceEventCode.Created:
|
||||
return new WebhookInvoiceEvent(WebhookEventType.InvoiceCreated, storeId);
|
||||
|
|
Loading…
Add table
Reference in a new issue