From b40af9b1c932315d67555f8fe2d5ac0ed5d34945 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 27 Jun 2024 14:22:52 +1000 Subject: [PATCH] fix: Use global payments to fix bug with payments needing a restart --- payments.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/payments.py b/payments.py index c3b71a2..840047e 100644 --- a/payments.py +++ b/payments.py @@ -42,6 +42,8 @@ names = { def generate_payment(name,email,mobile,address,country,cart,hns,promo=False): + global payments + # Generate a payment object payment_id = generate_payment_id() if payment_id == "ERROR": @@ -84,6 +86,7 @@ def generate_payment(name,email,mobile,address,country,cart,hns,promo=False): def check_payments(): + global payments # Get all txs data = requests.get(f"https://api.niami.io/address/{HNSaddress}") if data.status_code != 200: @@ -100,7 +103,6 @@ def check_payments(): # Convert to HNS outputValue = int(output['value']) outputValue = str(float(outputValue)) - print(outputValue,flush=True) if outputValue in payments: # Payment found