mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-04 08:37:30 +00:00
store: read invoices on BTCPay payment events
This commit is contained in:
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
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
Reference in new issue
Block a user