Spaces:
Sleeping
Sleeping
Update components/getinvoices.py
Browse files- components/getinvoices.py +23 -1
components/getinvoices.py
CHANGED
|
@@ -6,6 +6,28 @@ coll=db["x402ify_col"]
|
|
| 6 |
|
| 7 |
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
def GetInvoices(owner,endpoint_linker):
|
| 10 |
|
| 11 |
|
|
@@ -28,4 +50,4 @@ def GetInvoices(owner,endpoint_linker):
|
|
| 28 |
|
| 29 |
return all_invoices
|
| 30 |
|
| 31 |
-
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def GetInvoices(owner):
|
| 13 |
+
doc = coll.find_one({"owner": owner})
|
| 14 |
+
all_invoices = []
|
| 15 |
+
|
| 16 |
+
if doc:
|
| 17 |
+
# Extract invoices from 'endpoints'
|
| 18 |
+
if "endpoints" in doc:
|
| 19 |
+
for ep in doc["endpoints"]:
|
| 20 |
+
all_invoices.extend(ep.get("invoices", []))
|
| 21 |
+
|
| 22 |
+
# Extract invoices from 'dynamicendpoints'
|
| 23 |
+
if "dynamicendpoints" in doc:
|
| 24 |
+
for dep in doc["dynamicendpoints"]:
|
| 25 |
+
all_invoices.extend(dep.get("invoices", []))
|
| 26 |
+
|
| 27 |
+
return all_invoices
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
'''
|
| 31 |
def GetInvoices(owner,endpoint_linker):
|
| 32 |
|
| 33 |
|
|
|
|
| 50 |
|
| 51 |
return all_invoices
|
| 52 |
|
| 53 |
+
'''
|