From 7ed847251ff687620ceb995f7641a692aad96880 Mon Sep 17 00:00:00 2001 From: 3wc <3wc.cyberia@doesthisthing.work> Date: Wed, 21 Jul 2021 00:22:58 +0200 Subject: [PATCH] Don't load /btcpay if BTCPAY_PRIVATE_KEY un-set --- capsulflask/payment.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/capsulflask/payment.py b/capsulflask/payment.py index 1029f7d..b11c164 100644 --- a/capsulflask/payment.py +++ b/capsulflask/payment.py @@ -48,6 +48,10 @@ def validate_dollars(): def btcpay_payment(): errors = list() + if current_app.config['BTCPAY_PRIVATE_KEY'] == "": + flash("BTCPay is not enabled on this server") + return redirect(url_for("console.account_balance")) + if request.method == "POST": result = validate_dollars() errors = result[0] @@ -289,4 +293,4 @@ def success(): # except stripe.error.SignatureVerificationError: # print("/payment/stripe/webhook returned 400: invalid signature") # abort(400, "invalid signature") - \ No newline at end of file +