thiswebshoprules

git clone https://git.tarina.org/thiswebshoprules
Log | Files | Refs

paybtc.html (2664B)


      1 $def with (invoice, btcaddress, btcuri, showpayment, bag, productname, db, getprice, getrate, ordertype, pendinginfo, eur_to_sat)
      2 $ qr = '/static/qr/' + btcaddress + '.png'
      3 <script>
      4 function copy() {
      5   let textarea = document.getElementById("payreq");
      6   textarea.select();
      7   document.execCommand("copy");
      8 }
      9 </script>
     10 <meta http-equiv="refresh" content="60" />
     11 
     12 <div id="container">
     13 <br>
     14 <a href="/checkout">Go back!</a>
     15 
     16 <br>
     17 in your order:<br> 
     18 $ totsats=0
     19 $ toteuro=0
     20 $for i in bag: 
     21     $ goodies = db.query("SELECT * FROM soundlink WHERE id='" +i.product+"';")
     22     $code:
     23         price = getprice(i.product)
     24         quantity = i.quantity
     25         p_totsats=i.quantity*price[0]
     26         p_toteuro=i.quantity*price[1]
     27     $i.quantity x $productname(i.product)
     28     $p_totsats $p_toteuro&euro;<br>
     29     $for g in goodies:
     30         $if g.soundname[-5:] == '.jpeg' or g.soundname[-4:] == '.png':
     31             <img src="/static/img/thumb/$g.soundname" style="width:120px">
     32             <br>
     33     $code:
     34         totsats += p_totsats
     35         toteuro += p_toteuro
     36 $if totsats > 0:
     37     <br>
     38 
     39 $if ordertype() == 'digital':
     40     <h2>Digital goods will be shipped to your email once invoice paid..</h2>
     41 $else:
     42     $ shippinginfo = db.select('shipping', where="country='" + pendinginfo.country + "'", what='price, days')[0]
     43     Shipping cost to $pendinginfo.country is <br>$eur_to_sat(shippinginfo.price) Satoshi or ~ $(shippinginfo.price/100)&euro; <br>
     44     Shipping estimate is $shippinginfo.days days<br>
     45     $code:
     46         totsats += eur_to_sat(shippinginfo.price)
     47         toteuro += shippinginfo.price/100
     48     <pre>
     49     First Name: $pendinginfo.firstname
     50     Last Name: $pendinginfo.lastname
     51     Country: $pendinginfo.country
     52     Address: $pendinginfo.address
     53     Town: $pendinginfo.town
     54     Postalcode: $pendinginfo.postalcode
     55     Email: $pendinginfo.email
     56     </pre>
     57 
     58 <br>
     59 $if totsats > 0:
     60     total: $totsats Satoshi ~ $(toteuro)&euro;
     61     with rate: $getrate()&euro;/₿
     62 
     63 <br>
     64 Order is only reserved once paid.
     65 <br>
     66 <br>
     67 
     68 $if showpayment == []:
     69     <h5>Status: not paid</h5>
     70 $else:
     71     $for i in showpayment:
     72         <h2>Status:</h2>
     73         <h2>txid: $i['txids']</h2>
     74         <h2>confirmations: $i['confirmations']</h2>
     75 <br>
     76 <img style="width:220px" src="$qr">
     77 <div id='hash'>
     78 <h2>bitcoin address:</h2>
     79 <textarea id='payid'>
     80 $btcaddress
     81 </textarea>
     82 <h2>pay uri:</h2>
     83 <textarea id='payreq'>
     84 $btcuri
     85 </textarea>
     86 <br>
     87 <button id="copybutton" onclick="copy()">Copy</button>
     88 <button id="backbutton" autofocus onclick="parent.location='/payln/$invoice.invoice_key'">Pay with Lightning</button>
     89 </div>
     90 
     91 <br>
     92 <br>
     93 
     94 <a href="/checkout">Go back!</a>
     95 
     96 <br>
     97 </div>
     98 <br>
     99 <br>
    100 <br>
    101 <br>