Remove desc hash, always add memo to invoices
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2022-03-01 13:26:21 -06:00
parent 4c51b9c966
commit 9903683536
2 changed files with 5 additions and 4 deletions

View File

@@ -20,7 +20,7 @@ class LnurlpayController < ApplicationController
def invoice
amount = params[:amount].to_i / 1000 # msats
address = params[:address]
comment = params[:comment]
comment = params[:comment] || ""
if !valid_amount?(amount)
render json: { status: "ERROR", reason: "Invalid amount" }
@@ -32,10 +32,12 @@ class LnurlpayController < ApplicationController
return
end
memo = "Sats for #{address}"
memo = "#{memo}: \"#{comment}\"" if comment.present?
payment_request = @user.ln_create_invoice({
amount: amount, # we create invoices in sats
description_hash: Digest::SHA2.hexdigest(metadata(address)),
memo: comment
memo: memo
})
render json: {