WIP Persist zaps, create and send zap receipts
This commit is contained in:
@@ -52,7 +52,7 @@ class LnurlpayController < ApplicationController
|
||||
return
|
||||
end
|
||||
|
||||
if params[:nostr].present?
|
||||
if params[:nostr].present?# TODO && Setting.nostr_enabled?
|
||||
handle_zap_request amount, params[:nostr], params[:lnurl]
|
||||
else
|
||||
handle_pay_request address, amount, comment
|
||||
@@ -131,6 +131,9 @@ class LnurlpayController < ApplicationController
|
||||
return
|
||||
end
|
||||
|
||||
# TODO might want to use the existing invoice and zap record if there are
|
||||
# multiple calls with the same zap request
|
||||
|
||||
desc = "Zap for #{@user.address}"
|
||||
desc = "#{desc}: \"#{event.content}\"" if event.content.present?
|
||||
|
||||
@@ -142,6 +145,10 @@ class LnurlpayController < ApplicationController
|
||||
}
|
||||
)
|
||||
|
||||
@user.zaps.create! request: event,
|
||||
payment_request: invoice["payment_request"],
|
||||
amount: amount
|
||||
|
||||
render json: { status: "OK", pr: invoice["payment_request"] }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user