payln.html (1909B)
1 $def with (lninvoice,invoice,bag,productname,digitalkey,db,getprice,getrate) 2 $ qr = '/static/qr/' + invoice['invoice_key'] + '.png' 3 <script> 4 function copy() { 5 let textarea = document.getElementById("payreq"); 6 textarea.select(); 7 document.execCommand("copy"); 8 } 9 </script> 10 11 <div id="container"> 12 $if lninvoice['status'] != 'paid': 13 <meta http-equiv="refresh" content="30" /> 14 <a href="/checkout">Go back!</a> 15 <br> 16 <h2>Pay with Bitcoin Lightning</h2> 17 $else: 18 <h3>Payment recieved!</h3> 19 $if digitalkey: 20 <p>link to your digital goodies is in your mail!</p><br> 21 <img src="/static/jamesfrancothanks.gif" style="width:300px"><br> 22 <a href="/">Back to beginning</a> 23 <br> 24 in your order:<br> 25 $ totsats=0 26 $ toteuro=0 27 $for i in bag: 28 $ goodies = db.query("SELECT * FROM soundlink WHERE id='" +i.product+"';") 29 $code: 30 price = getprice(i.product) 31 quantity = i.quantity 32 p_totsats=i.quantity*price[0] 33 p_toteuro=i.quantity*price[1] 34 $i.quantity x $productname(i.product) 35 $p_totsats $p_toteuro€<br> 36 $for g in goodies: 37 $if g.soundname[-5:] == '.jpeg' or g.soundname[-4:] == '.png': 38 <img src="/static/img/thumb/$g.soundname" style="width:120px"> 39 <br> 40 $code: 41 totsats += p_totsats 42 toteuro += p_toteuro 43 $if totsats > 0: 44 <br> 45 total: $totsats Satoshi or $toteuro €<br> 46 with rate: $getrate()€/₿ 47 <h2>status: $lninvoice['status']</h2> 48 <br> 49 <a href="lightning:$lninvoice['bolt11']"><img src="$qr"></a> 50 <div id='hash'> 51 <h4>id:</h4> 52 <textarea id='payid'> 53 $lninvoice['label'] 54 </textarea> 55 <h4>bolt11:</h4> 56 <textarea id='payreq'> 57 $lninvoice['bolt11'] 58 </textarea> 59 <br> 60 <button id="copybutton" onclick="copy()">Copy</button> 61 <button id="backbutton" autofocus onclick="parent.location='/paybtc/$invoice.invoice_key'">Pay with Bitcoin on-chain</button> 62 </div> 63 </div> 64