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 4c0d8283e3 - Show all commits

View File

@@ -6,7 +6,7 @@ class WebhooksController < ApplicationController
def lndhub
begin
payload = JSON.parse(request.body.read, symbolize_names: true)
raucao marked this conversation as resolved
Review

doesn't rails automatically parse the JSON because the proper content type is set?
so params[:type] and params[:user_login] should be enough?

doesn't rails automatically parse the JSON because the proper content type is set? so `params[:type]` and `params[:user_login]` should be enough?
Review

I didn't know, so I tried (also with explicitly setting the content type in the spec). Doesn't do it.

I didn't know, so I tried (also with explicitly setting the content type in the spec). Doesn't do it.
return unless payload[:type] == "incoming"
head :no_content and return unless payload[:type] == "incoming"
rescue
head :unprocessable_entity and return
end