I am VERY new to LN and a not a developer per-se and I am creating a basic LN enable website but I need to be able to create LNurl invoices with a "SuccessAction" param, so when they are paid via a mobile phone wallet, I can redirect the user back to the browser.
I would like to first try it by creating the invoice "manually" with the parameter, but I have no idea on how.
If I am completely lost, please tell me ;)
I'm not sure what you're asking for. There are no LNURL invoices, just regular lightning invoices. Since you bring up the "SuccessAction" param I'll assume you want to implement the payRequest spec for LNURL with the successAction spec?

This is a high-level overview of how it works (where 'U' is the user/wallet, 'S' is the server, and 'N' is the lightning node):
U: Bech32 decodes lnurl to get a plaintext ascii url
U->S: makes a request to the url S->U: Gives json back with min/max amounts and a callback url
U->S: Requests callback url with amount query param
S->N: Requests invoice with amount from query param N->S: Sends invoice back to server
S->U: Sends json with invoice (in 'pr' property) and a url (wrapped in an object under the 'successAction' property) back to user

The invoice that's generated will typically leverage a lightning node. If you want to construct an invoice manually you can follow the BOLT11 spec but it would be better if you just use your lightning node since the lightning node will have to know the payment_preimage to complete the payment anyway
reply
So basically what I want is this: My site shows an invoice in a mobile browser, user clics to pay it, wallet opens, users pays, wallet sends the user back to browser.
I can already do all of that (using bolt-11 invoices and "lightning:invoice") except the last step, so as I understand, SuccessAction is what I need to use.
Am I lost?
reply
Ok I think I understand more. It sounds like you are already generating lnurls that deeplink to lightning wallets from the browser. In that case, yes, all you need to do is send the 'successAction' object in the response given from the callback url. To display a url, the successAction object needs to look like:
{ "tag": "url", "description": "Thank you for your purchase. Here is your order details", // Up to 144 characters "url": "https://www.ln-service.com/order/<orderId>" // url domain must be the same as `callback` domain at step 3 }
^ sample json taken from LUD-09 spec
reply
Oh, thanks. hmm, maybe we are getting there but still lost. I don't think I am generating lnurls, my deeplinks look like this: "lightning: lnbc..."
So I guess I need to learn 2 steps:
  1. How to create LNurls (instead of bolt11)
  2. Encode the LNurl with params into a deeplink
is that right?
reply
reply
It depends on what kind of website you have
Are you able to install software on the server that your website runs on?
How about plugins? If so, where do you get plugins? You might be able to search there
Is it a wordpress site? Shopify?
Consider hiring someone to help you do this
reply
You mean how to encode ln invoice into LNURL?
reply
that would help, just a simple place to convert a ln invoice into a LNURL in which I can add a SucessAction parameter. Or simply a place to create LNURL invoices that include SuccessAction params (I tried to do in inside LNbits but no).
reply
I just don't know where to put the param. (like I said, I am just an aficionado trying to make something cool with LN)
reply