From c0f4e7925e08cd5ff61945a19a73d7b4b627d1d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sat, 4 May 2024 17:07:23 +0200 Subject: [PATCH] Use zap comment for description/memo But use the hashed zap request event for the description hash. --- app/controllers/lnurlpay_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/lnurlpay_controller.rb b/app/controllers/lnurlpay_controller.rb index 40681a5..47265ae 100644 --- a/app/controllers/lnurlpay_controller.rb +++ b/app/controllers/lnurlpay_controller.rb @@ -131,10 +131,13 @@ class LnurlpayController < ApplicationController return end + desc = "Zap for #{@user.address}" + desc = "#{desc}: \"#{event.content}\"" if event.content.present? + invoice = LndhubManager::CreateUserInvoice.call( user: @user, payload: { amount: amount, # sats - description: event.to_json, + description: desc, description_hash: Digest::SHA256.hexdigest(event.to_json), } )