fix: Use the file instead of global var
All checks were successful
Build Docker / Build Image (push) Successful in 32s
All checks were successful
Build Docker / Build Image (push) Successful in 32s
This commit is contained in:
@@ -42,7 +42,9 @@ names = {
|
||||
|
||||
|
||||
def generate_payment(name,email,mobile,address,country,cart,hns,promo=False):
|
||||
global payments
|
||||
payments = {}
|
||||
with open(path+'payments.json', 'r') as f:
|
||||
payments = json.load(f)
|
||||
|
||||
# Generate a payment object
|
||||
payment_id = generate_payment_id()
|
||||
@@ -86,7 +88,10 @@ def generate_payment(name,email,mobile,address,country,cart,hns,promo=False):
|
||||
|
||||
|
||||
def check_payments():
|
||||
global payments
|
||||
payments = {}
|
||||
with open(path+'payments.json', 'r') as f:
|
||||
payments = json.load(f)
|
||||
|
||||
# Get all txs
|
||||
data = requests.get(f"https://api.niami.io/address/{HNSaddress}")
|
||||
if data.status_code != 200:
|
||||
|
||||
Reference in New Issue
Block a user