feat: Add more logging
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:
@@ -90,27 +90,29 @@ def check_payments():
|
||||
return False
|
||||
data = data.json()
|
||||
if data['success'] == False:
|
||||
print(data, "Failed",flush=True)
|
||||
return False
|
||||
|
||||
data = data['data']
|
||||
|
||||
for tx in data:
|
||||
for output in tx['outputs']:
|
||||
if output['address'] == HNSaddress:
|
||||
# Convert to HNS
|
||||
outputValue = int(output['value'])
|
||||
outputValue = str(float(outputValue))
|
||||
print(outputValue,flush=True)
|
||||
|
||||
if outputValue in payments:
|
||||
# Payment found
|
||||
payment = payments[outputValue]
|
||||
if payment['status'] == "Pending":
|
||||
if not finalise_payment(payment):
|
||||
print("Failed to finalise payment",flush=True)
|
||||
return False
|
||||
payment['status'] = "Paid"
|
||||
with open(path+'payments.json', 'w') as f:
|
||||
json.dump(payments, f, indent=4)
|
||||
print("Payment finalised")
|
||||
print("Payment finalised",flush=True)
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +122,7 @@ def finalise_payment(payment):
|
||||
data = payment
|
||||
resp = requests.post(url, json=data)
|
||||
if resp.status_code != 200:
|
||||
print(resp.text)
|
||||
print(resp.text,flush=True)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user