fix: Incorrect file location fix
All checks were successful
Build Docker / Build Image (push) Successful in 21s

This commit is contained in:
2024-02-12 18:02:19 +11:00
parent 4e8052eecb
commit 41c9d1829d

View File

@@ -15,18 +15,18 @@ if os.getenv('LOCAL') == "true":
if os.path.exists(path+'payments.json'): if os.path.exists(path+'payments.json'):
with open('payments.json', 'r') as f: with open(path+'payments.json', 'r') as f:
payments = json.load(f) payments = json.load(f)
else: else:
with open(path+'payments.json', 'w') as f: with open(path+'payments.json', 'w') as f:
json.dump(payments, f, indent=4) json.dump(payments, f, indent=4)
used = [] used = []
if os.path.exists('used.json'): if os.path.exists(path+'used.json'):
with open('used.json', 'r') as f: with open(path+'used.json', 'r') as f:
used = json.load(f) used = json.load(f)
else: else:
with open('used.json', 'w') as f: with open(path+'used.json', 'w') as f:
json.dump(used, f, indent=4) json.dump(used, f, indent=4)
HNSaddress = os.getenv('ADDRESS') HNSaddress = os.getenv('ADDRESS')
@@ -64,7 +64,7 @@ def generate_payment(name,email,mobile,address,country,cart,hns):
finalPriceDolarydoo = float(finalPrice) * 1000000 finalPriceDolarydoo = float(finalPrice) * 1000000
payments[finalPriceDolarydoo] = payment payments[finalPriceDolarydoo] = payment
# Save payments to file # Save payments to file
with open('payments.json', 'w') as f: with open(path+'payments.json', 'w') as f:
json.dump(payments, f, indent=4) json.dump(payments, f, indent=4)
@@ -98,7 +98,7 @@ def check_payments():
if not finalise_payment(payment): if not finalise_payment(payment):
return False return False
payment['status'] = "Paid" payment['status'] = "Paid"
with open('payments.json', 'w') as f: with open(path+'payments.json', 'w') as f:
json.dump(payments, f, indent=4) json.dump(payments, f, indent=4)
print("Payment finalised") print("Payment finalised")
@@ -122,7 +122,7 @@ def generate_payment_id():
while True: while True:
if id not in used: if id not in used:
used.append(id) used.append(id)
with open('used.json', 'w') as f: with open(path+'used.json', 'w') as f:
json.dump(used, f, indent=4) json.dump(used, f, indent=4)
# Return the id padded to 2 digits # Return the id padded to 2 digits