thiswebshoprules

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

commit 18bc3234ac6a2212166810a0782325899759edfc
parent e11b45963ff1d4fff4f01b7a797e851a2e60088b
Author: rob <rob@tarina.org>
Date:   Sat, 10 Jun 2023 11:06:12 +0300

msat purge

Diffstat:
Mpublic_html/templates/index.html | 2+-
Mpublic_html/templates/orders.html | 4++--
Mserver.py | 15+++++++++------
3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/public_html/templates/index.html b/public_html/templates/index.html @@ -47,7 +47,7 @@ $for i in products: <code>$i.category</code> <pre>$i.description</pre> $if i.available > 0: - Price $sat Satoshi ~ $euro &euro; <a href="?putinbag=$i.id#$i.id">order</a><br> + Price $sat Satoshi ~ $euro &euro; <a href="?putinbag=$i.id#$i.id">add to bag</a><br> Available $i.available pcs $else: SOLD OUT! check back later. diff --git a/public_html/templates/orders.html b/public_html/templates/orders.html @@ -33,9 +33,9 @@ $for i in payments: <b>order status: $i.status</b> <b>ln status: $ln['status']</b> <a href=$link>$i.invoice_key</a> - $ln['msatoshi'] mSatoshis $if ln['status'] == 'paid': - $ totsats=totsats+ln['msatoshi'] + $ln['amount_msat'] mSatoshis + $ totsats=totsats+ln['amount_msat'] $i.payment $i.ln in your order:<br> diff --git a/server.py b/server.py @@ -526,18 +526,18 @@ class orders(): elif payment.payment == 'Bitcoin Lightning': paylink = 'payln/' if i.status == 'thankyou': - msg="Hi " + customer.firstname + " " + customer.lastname + ", thank you for your order! You can track the status of your order at "+baseurl+'/'+paylink+i.key + msg="Hi " + customer.email + ", thank you for your order! You can track the status of your order at "+baseurl+'/'+paylink+i.key sendmail(customer.email, 'Tarina Shop, a thank you!', msg) elif i.status == 'shipped': - msg="Hi " + customer.firstname + " " + customer.lastname + ", your order has been shipped!. You can track the status of your order at "+baseurl+'/'+paylink+i.key + msg="Hi " + customer.email + ", your order has been shipped!. You can track the status of your order at "+baseurl+'/'+paylink+i.key sendmail(customer.email, 'Tarina Shop, your order has been shipped!', msg) elif i.status == 'paynotice': - msg="Hi " + customer.firstname + " " + customer.lastname + ", we noticed you have an unpaid order in our shop, thank you. You can track the status of your order at " + baseurl + paylink + payment.invoice_key + msg="Hi " + customer.email + ", we noticed you have an unpaid order in our shop, thank you. You can track the status of your order at " + baseurl + paylink + payment.invoice_key sendmail(customer.email, 'Tarina Shop, order waiting for payment!', msg) elif i.status == 'paid': - msg="Hi " + customer.firstname + " " + customer.lastname + ", thank you! payment received. You can track the status of your order at " + baseurl + paylink + payment.invoice_key + msg="Hi " + customer.email + ", thank you! payment received. You can track the status of your order at " + baseurl + paylink + payment.invoice_key sendmail(customer.email, 'Tarina Shop, order payment received', msg) - web.seeother(referer) + raise web.seeother(referer) payments = db.select('invoices', what='btc, ln, invoice_key, products, payment, amount, totsats, timestamp, status, datepaid, dateshipped', order='timestamp DESC') if i.key == None and i.status != None: status = i.status @@ -552,8 +552,9 @@ class orders(): removed=0 for i in payments: ln = getinvoice(i.ln) + print(ln) if ln['status'] == 'paid': - totsats=totsats+ln['msatoshi'] + totsats=totsats+ln['amount_msat'] paid=paid+1 s = db.select('invoices', where="invoice_key='"+i.invoice_key+"'", what='status')[0] if s.status == None: @@ -564,6 +565,8 @@ class orders(): nonshipped=nonshipped+1 if i.status == 'pickup': pickup=pickup+1 + if i.status == "removed": + removed=removed+1 else: s = db.select('invoices', where="invoice_key='"+i.invoice_key+"'", what='status')[0] if s.status == None: