Add Webhooks and XMPP notifications for incoming sats #79

Merged
raucao merged 10 commits from feature/webhooks into master 2023-01-13 04:33:02 +00:00
Showing only changes of commit b0c787bbc7 - Show all commits

View File

@@ -11,7 +11,7 @@ class WebhooksController < ApplicationController
head :unprocessable_entity and return
end
user = User.find_by(ln_account: payload[:user_login])
user = User.find_by!(ln_account: payload[:user_login])
raucao marked this conversation as resolved Outdated
Outdated
Review

should not be the case, but this might be nil. maybe we should do a User.find_by!

should not be the case, but this might be nil. maybe we should do a `User.find_by!`

Good idea! Fails much cleaner and more expressively than when trying to access properties on nil later.

Good idea! Fails much cleaner and more expressively than when trying to access properties on `nil` later.
# TODO make configurable
notify_xmpp(user.address, payload[:amount], payload[:memo])