store: read invoices on BTCPay payment events

This commit is contained in:
shum committed 2026-10-22 02:26:17 +00:00
1 parent b85a513514
commit 91b18bbbb6
2 files changed
+4 -3

No files matched your search

@@ -81,8 +81,9 @@ xmrMethodId = "XMR-CHAIN"
knownMethodIds :: [Text]
knownMethodIds = [btcMethodId, xmrMethodId]
-- The last two are the only events a payment into a closed invoice sends.
actedOnEventTypes :: [Text]
actedOnEventTypes = ["InvoiceProcessing", "InvoiceSettled", "InvoiceExpired", "InvoiceInvalid"]
actedOnEventTypes = ["InvoiceProcessing", "InvoiceSettled", "InvoiceExpired", "InvoiceInvalid", "InvoiceReceivedPayment", "InvoicePaymentSettled"]
maxErrorBytes :: Int64
maxErrorBytes = 4000
+2 -2
View File
@@ -435,7 +435,7 @@ testWebhookAccepts :: IO ()
testWebhookAccepts =
mapM_
(\t -> let b = webhookEvent t ref in verifyEvent (webhookSigHeader secret b) b `shouldBe` Right (Just ref))
["InvoiceProcessing", "InvoiceSettled", "InvoiceExpired", "InvoiceInvalid"]
["InvoiceProcessing", "InvoiceSettled", "InvoiceExpired", "InvoiceInvalid", "InvoiceReceivedPayment", "InvoicePaymentSettled"]
testWebhookHeaderCase :: IO ()
testWebhookHeaderCase = do
@@ -449,7 +449,7 @@ testWebhookUppercaseHex = do
testWebhookIgnoresOtherType :: IO ()
testWebhookIgnoresOtherType = do
let b = webhookEvent "InvoiceReceivedPayment" ref
let b = webhookEvent "InvoiceCreated" ref
verifyEvent (webhookSigHeader secret b) b `shouldBe` Right Nothing
testWebhookIgnoresUnreadableBody :: IO ()