getAlby / lightning-browser-extension

The Bitcoin Lightning Browser Extension that brings deep Lightning & Nostr integration to the web. Wallet interface to multiple lightning nodes and key signer for Nostr, Liquid and onchain use.
https://getalby.com/#extension
MIT License
538 stars 194 forks source link

[BUG] Note information note showing up #2312

Open RenegadeButcher opened 1 year ago

RenegadeButcher commented 1 year ago

Is there an existing issue for this?

Describe the bug

If I generate an invoice with my Alby wallet, regardless of if it's with the browser extenion, linked to Blue Wallet or through the Wordpress extension, notes added during payments do not seem to appear. I've tested this both with Blue Wallet and Wallet of Satoshi on the sending side. Note information isn't appearing in the wallet, or logged in to the Alby website.

Having reliable notes come through would be a huge boon. I'd like to enable 1-time lightning sales for products, but without a user being able to attach contact or shipping info it's a mess and requires a separate conversation with the customer through other means.

Screenshots [optional]

No response

Steps To Reproduce

  1. Generate an invoice to an Alby Wallet
  2. Pay said invoice with Wallet of Satoshi
  3. Include some data in the payment note
  4. Observe the lack of information on the receiving side

Expected behavior

Payment note information should be available and usable across all lightning wallets

Alby information

Current plugin, website and LNDhub linked wallets

Device information

No response

Additional context

No response

Are you working on this?

None

reneaaron commented 1 year ago

Thanks for your report.

To my knowledge there is no way to attach a comment to an invoice. (i see that WoS allows to add that in their app, but that won't work on a protocol level, also I know no other app that allows that, also checked BlueWallet & ZEUS)

You can only attach comments as you receive to a lightning address (or any LNURL). This is also why it works with the widget (there you send to an LNURL and the comment is added in the UI of the widget, if you pay the generated QR code with WoS the comment will show up on both your Alby account and the extension).

I think the problem here really is WoS displaying the "add note" for invoices (while it should only be in there for LNURL payments).

RenegadeButcher commented 1 year ago

Hmmmmm, interesting. So, if I send a Zap on Nostr from my Alby wallet, I can attach a note and it will carry through. Even if I do so on something like Snort, and pay the generated invouce with my Alby wallet. Now, that comment isn't entered on the wallet, but as I setup the Zap. Perhaps that's the difference? It's possible to only attach the note at the time the invoice is generated?

On Fri, Apr 7, 2023, 4:26 PM René Aaron @.***> wrote:

Thanks for your report.

To my knowledge there is no way to attach a comment to an invoice. (i see that WoS allows to add that in their app, but that won't work on a protocol level, also I know no other app that allows that, also checked BlueWallet & ZEUS)

You can only attach comments as you receive to a lightning address (or any LNURL). This is also why it works with the widget (there you send to an LNURL and the comment is added in the UI of the widget, if you pay the generated QR code with WoS the comment will show up on both your Alby account and the extension).

I think the problem here really is WoS displaying the "add note" for invoices (while it should only be in there for LNURL payments).

— Reply to this email directly, view it on GitHub https://github.com/getAlby/lightning-browser-extension/issues/2312#issuecomment-1500660631, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2IS4DEJRIUBEVYFZT2NTOTXACBA7ANCNFSM6AAAAAAWVU6PLE . You are receiving this because you authored the thread.Message ID: @.***>

reneaaron commented 1 year ago

Zaps work a bit different on a technical level, it's different from Lightning Address payments. If you pay to your getAlby Lightning Address from WoS the comment will also show up.

RenegadeButcher commented 1 year ago

Hmmm, interesting. Would there be a way to generate a payment of a set amount to a lightning address with a button VS creating an invoice?

On Fri, Apr 7, 2023, 5:28 PM René Aaron @.***> wrote:

Zaps work a bit different on a technical level, it's different from Lightning Address payments. If you pay to your getAlby Lightning Address from WoS the comment will also show up.

— Reply to this email directly, view it on GitHub https://github.com/getAlby/lightning-browser-extension/issues/2312#issuecomment-1500696406, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2IS4DAGDTTRYBXK37XQB6TXACII5ANCNFSM6AAAAAAWVU6PLE . You are receiving this because you authored the thread.Message ID: @.***>

RenegadeButcher commented 1 year ago

Or here's another thought...could the pay wall potentially open a new windows or pop-up? I could use a paywall widget as a payment button then, that could open a page with a contact form where the customer could enter their information. I thought about using the pay wall and placing a form below, but it seems a bit clunky and having a min 1hr could be problematic. Maybe I can come up with a form that is one time use 🤔

On Fri, Apr 7, 2023, 5:44 PM Renegade Butcher < @.***> wrote:

Hmmm, interesting. Would there be a way to generate a payment of a set amount to a lightning address with a button VS creating an invoice?

On Fri, Apr 7, 2023, 5:28 PM René Aaron @.***> wrote:

Zaps work a bit different on a technical level, it's different from Lightning Address payments. If you pay to your getAlby Lightning Address from WoS the comment will also show up.

— Reply to this email directly, view it on GitHub https://github.com/getAlby/lightning-browser-extension/issues/2312#issuecomment-1500696406, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2IS4DAGDTTRYBXK37XQB6TXACII5ANCNFSM6AAAAAAWVU6PLE . You are receiving this because you authored the thread.Message ID: @.***>

reneaaron commented 1 year ago

Would there be a way to generate a payment of a set amount to a lightning address with a button VS creating an invoice?

Yes, that should be possible. However, that would need a specific lightning address that only allows payments for the given amount. Did you consider using BTCPay Server for that? I think they also allow customers to add information to an order.

RenegadeButcher commented 1 year ago

I have thought about BTCpay or LNbits, but I don't currently have the data connection to run a node for hot payments. Hopefully soon.

On Sat, Apr 8, 2023, 4:41 AM René Aaron @.***> wrote:

Would there be a way to generate a payment of a set amount to a lightning address with a button VS creating an invoice?

Yes, that should be possible. However, that would need a specific lightning address that only allows payments for the given amount. Did you consider using BTCPay Server for that? I think they also allow customers to add information to an order.

— Reply to this email directly, view it on GitHub https://github.com/getAlby/lightning-browser-extension/issues/2312#issuecomment-1500847900, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2IS4DCOYUSCHOC55V4XFI3XAEXF7ANCNFSM6AAAAAAWVU6PLE . You are receiving this because you authored the thread.Message ID: @.***>

bumi commented 1 year ago

When you use the @getalby.com lightning address you will see the user's details (comment + payername) if providerd on the getalby.com/user dashboard. Because those are not stored in the lightning invoice data itself they are not shown in the extension currently. But I think you can do your usecase if you use the getalby.com/user dashboard.

So what you can do on your server side is actually easily request an invoice through a getalby.com lightning address with a comment (that contains the buyer's information for example) and then pass this one to the user to pay and then check if the invoice is paid.

with the alby-tools NPM package this should be something like:

import { LightningAddress } from "alby-tools";

const ln = new LightningAddress("bumi@getalby.com");
await ln.fetch();

const invoice = await ln.requestInvoice({satoshi: 1000, comment: buyerInformation }); 

// pass the invoice to the visitor to pay
console.log(invoice.paymentRequest); 

// check if the invoice is paid
await invoice.isPaid();

// if you later need to initialize the Invoice object again to check the payment:
// save the paymentRequest and ideally the verify URL
invoice.paymentRequest
invoice.verify

// you can initialize an invoice object and check the payment again.
const invoice = new Invoice({pr: paymentRequest, verify: verifyURL});
await invoice.isPaid();

// if the user can present the preimage when using the Alby for example: 
const invoice = new Invoice({pr: paymentRequest});
await invoice.validatePreimage(params.preimage);

mybe I misunderstand your conversation here, but I think what you try to do should be simply possible.

RenegadeButcher commented 1 year ago

I think there are definitely way it could work, but it's probably down to me misunderstanding some intricacies of the protocol. I try 😂

I have success generating invoices for single purchases, but was hoping there was a way to implement this in something much like the donation button widget. Then an invoice is generated for the user on demand, it just doesn't work for sales if I don't know who paid lol

And if I generate an invoice, it works one time. This would hopefully be a single recurring button per item.

Yes, I can use BTCpay server or LNbits to accomplish this. But I was thinking this would be a really slick way to get the average WordPress user into simple lightning sales without needing to run a node or buy space on someone else's. WordPress is so widespread, a really simple solution like this would make mass adoption much easier.

And maybe it's not possible with the current way the protocol works?

On Mon, Apr 10, 2023, 8:08 AM Michael Bumann @.***> wrote:

When you use the @getalby.com lightning address you will see the user's details (comment + payername) if providerd on the getalby.com/user dashboard. Because those are not stored in the lightning invoice data itself they are not shown in the extension currently. But I think you can do your usecase if you use the getalby.com/user dashboard.

So what you can do on your server side is actually easily request an invoice through a getalby.com lightning address with a comment (that contains the buyer's information for example) and then pass this one to the user to pay and then check if the invoice is paid.

with the alby-tools NPM package https://github.com/getAlby/alby-tools this should be something like:

import { LightningAddress } from "alby-tools"; const ln = new @.***");await ln.fetch(); const invoice = await ln.requestInvoice({satoshi: 1000, comment: buyerInformation }); // pass the invoice to the visitor to payconsole.log(invoice.paymentRequest); // check if the invoice is paidawait invoice.isPaid();

// if you later need to initialize the Invoice object again to check the payment:// save the paymentRequest and ideally the verify URLinvoice.paymentRequestinvoice.verify // you can initialize an invoice object and check the payment again.const invoice = new Invoice({pr: paymentRequest, verify: verifyURL});await invoice.isPaid(); // if the user can present the preimage when using the Alby for example: const invoice = new Invoice({pr: paymentRequest});await invoice.validatePreimage(params.preimage);

mybe I misunderstand your conversation here, but I think what you try to do should be simply possible.

— Reply to this email directly, view it on GitHub https://github.com/getAlby/lightning-browser-extension/issues/2312#issuecomment-1501795728, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2IS4DCIKYJUSV4EBQF4VX3XAQA3RANCNFSM6AAAAAAWVU6PLE . You are receiving this because you authored the thread.Message ID: @.***>