Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Buy Now" style payment widget #32

Open
RenegadeButcher opened this issue Apr 6, 2023 · 9 comments
Open

Add "Buy Now" style payment widget #32

RenegadeButcher opened this issue Apr 6, 2023 · 9 comments

Comments

@RenegadeButcher
Copy link

I believe the issue with payment notes would need to be addressed first:
getAlby/lightning-browser-extension#2312

I have an idea that I think would probably be really useful in expand the WordPress LN publisher. I've attempted to make it work with the donate widget, and the twentyuno, but not quite there yet.

So, if there was a widget or shortcode that allowed you to do essentially what the donate widget does now, but also attach a string to the beginning of the payment note, it could be very useful as a "buy it now" type addition to a product listing. I'd love the ability to allow a customer to click "buy now with Lightning" and have it generate a QR code but append a product number to the note, while still allowing them to enter an email address or shipping address in the note. There may be easier ways to do that, but I think it would really expand the lightning marketplace.

One issue I found with the donation widget is that even if I pay an invoice with say, Wallet of Satoshi, the information I put in the payment note does not display in Alby. Not sure why it doesn't. (getAlby/lightning-browser-extension#2312)

Anyways, nothing critical but I thought I would pass the idea on. Perhaps there is already a solution to this I'm not yet aware of.

@reneaaron
Copy link
Contributor

Interesting idea, thanks for your feedback. Would it maybe be enough if you could see the URL where the payment happened?

@rolznz Are our getalby.com APIs ready for some LUD-18 metadata? Would be quite a nice use case for the new fields maybe?

@RenegadeButcher
Copy link
Author

RenegadeButcher commented Apr 7, 2023 via email

@reneaaron
Copy link
Contributor

I think this communication channel could be solved over e.g. nostr (instead of trying to attach it to a lightning invoice) where you can't reply and certain size restrictions apply (256 characters, even less for WoS lightning addresses).

I think there are already some ideas around P2P markets based on nostr. Attaching the current URI is an interesting idea though 👌

@RenegadeButcher
Copy link
Author

RenegadeButcher commented Apr 7, 2023 via email

@reneaaron
Copy link
Contributor

That could work very similar to how the lightning widget works now. You as a website owner get an embed code from a 3rd party website that creates those nostr widgets. (nostrwidgets.twentyuno.net? 😅) that you add to your website. (I currently have no time to work on something like that currently though 😉 )

@RenegadeButcher
Copy link
Author

RenegadeButcher commented Apr 7, 2023 via email

@rolznz
Copy link

rolznz commented Apr 10, 2023

I have a feeling WordPress already has all this great support for purchasing products, entering customer details etc as a CMS and it would not be worthwhile to re-implement this from scratch. The only thing really missing is a payment provider integration with lightning rather than using e.g. Stripe.

I think there might be some other plugins that do support Bitcoin and lightning payments like BTCPayServer, however if we had a payment option that used lightning addresses that would be even better, and might enable some of the details to be stored on the payment using LUD-18 like @reneaaron suggested. I think it is possible now using the new alby-tools package or something similar, but I don't know enough about WordPress development to be sure.

@bumi
Copy link
Contributor

bumi commented Apr 10, 2023

I think this should be already be possible with the plugin today if you do some customization.
the plugin allows you to create invoices and add a comment. This comment is saved in the WP transactions table. You could use this comment to store payerdata.

You only have to make sure that the verify call is made because WP currently does not have any way to do this periodically in the background.

so the flow would be:

  • allow user to enter some data
  • request an invoice which saves that data
  • prompt the user to pay
  • from the user's browser periodically check if the invoice is paid
  • if paid show a confirmation screen
  • admin checks the transaction table which contains the user provided data in the "comment" field

This can be done with the invoices API and some custom code: https://github.com/getAlby/lightning-publisher-wordpress/blob/master/includes/rest-api/controllers/class-rest-invoices.php

the new #27 paywall button could make this even easier.

@RenegadeButcher
Copy link
Author

RenegadeButcher commented Apr 10, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants