support calling multiple webhook urls

This commit is contained in:
Jesse de Wit
2023-11-14 20:51:40 +01:00
parent 501cc72998
commit 213856c5e9

View File

@@ -44,15 +44,15 @@ func (s *NotificationService) Notify(
},
}
var buf bytes.Buffer
err = json.NewEncoder(&buf).Encode(req)
if err != nil {
log.Printf("Failed to encode payment notification for %s: %v", pubkey, err)
return false, err
}
notified := false
for _, r := range registrations {
var buf bytes.Buffer
err = json.NewEncoder(&buf).Encode(req)
if err != nil {
log.Printf("Failed to encode payment notification for %s: %v", pubkey, err)
return false, err
}
resp, err := http.DefaultClient.Post(r, "application/json", &buf)
if err != nil {
log.Printf("Failed to send payment notification for %s to %s: %v", pubkey, r, err)