fix: Use global payments to fix bug with payments needing a restart
All checks were successful
Build Docker / Build Image (push) Successful in 36s
All checks were successful
Build Docker / Build Image (push) Successful in 36s
This commit is contained in:
@@ -42,6 +42,8 @@ names = {
|
|||||||
|
|
||||||
|
|
||||||
def generate_payment(name,email,mobile,address,country,cart,hns,promo=False):
|
def generate_payment(name,email,mobile,address,country,cart,hns,promo=False):
|
||||||
|
global payments
|
||||||
|
|
||||||
# Generate a payment object
|
# Generate a payment object
|
||||||
payment_id = generate_payment_id()
|
payment_id = generate_payment_id()
|
||||||
if payment_id == "ERROR":
|
if payment_id == "ERROR":
|
||||||
@@ -84,6 +86,7 @@ def generate_payment(name,email,mobile,address,country,cart,hns,promo=False):
|
|||||||
|
|
||||||
|
|
||||||
def check_payments():
|
def check_payments():
|
||||||
|
global payments
|
||||||
# Get all txs
|
# Get all txs
|
||||||
data = requests.get(f"https://api.niami.io/address/{HNSaddress}")
|
data = requests.get(f"https://api.niami.io/address/{HNSaddress}")
|
||||||
if data.status_code != 200:
|
if data.status_code != 200:
|
||||||
@@ -100,7 +103,6 @@ def check_payments():
|
|||||||
# Convert to HNS
|
# Convert to HNS
|
||||||
outputValue = int(output['value'])
|
outputValue = int(output['value'])
|
||||||
outputValue = str(float(outputValue))
|
outputValue = str(float(outputValue))
|
||||||
print(outputValue,flush=True)
|
|
||||||
|
|
||||||
if outputValue in payments:
|
if outputValue in payments:
|
||||||
# Payment found
|
# Payment found
|
||||||
|
|||||||
Reference in New Issue
Block a user