SatSale

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit bf900203e924159c7f7dea968944080bbab7befb
parent a0bf4dc24d501277e08adc62d6626402ab3e0b48
Author: Kristaps Kaupe <kristaps@blogiem.lv>
Date:   Thu, 23 Dec 2021 10:08:54 +0200

Support Lightning / Onchain payment method switch for c-lightning (#29)


Diffstat:
Msatsale.py | 1+
Mtemplates/index.html | 7+++++++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/satsale.py b/satsale.py @@ -58,6 +58,7 @@ def index(): def pay(): params = dict(request.args) params["lnd_enabled"] = config.pay_method == "lnd" + params["cln_enabled"] = config.pay_method == "clightning" params["redirect"] = config.redirect # Render payment page with the request arguments (?amount= etc.) headers = {"Content-Type": "text/html"} diff --git a/templates/index.html b/templates/index.html @@ -53,6 +53,13 @@ <button class="button button1" onclick="replaceUrlParam(window.location, 'method', 'lnd');">Lightning Payment</button> {% endif %} {% endif %} + {% if params.cln_enabled %} + {% if params.method != "bitcoind"%} + <button class="button button1" onclick="replaceUrlParam(window.location, 'method', 'bitcoind');">Onchain Payment</button> + {% else %} + <button class="button button1" onclick="replaceUrlParam(window.location, 'method', 'clightning');">Lightning Payment</button> + {% endif %} + {% endif %} </div> <div id="right" style="text-align: right; padding: 10px 10px;">