Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,16 +20,15 @@ coll=db["agentpaymentcol"]
|
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
class Agent(BaseModel):
|
| 29 |
-
|
| 30 |
-
|
| 31 |
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
def load_keypair(agent):
|
| 35 |
|
|
@@ -63,9 +62,24 @@ def Agent(request:Request):
|
|
| 63 |
|
| 64 |
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
|
| 68 |
|
|
|
|
|
|
|
| 69 |
|
| 70 |
@app.get("/agent/{id}")
|
| 71 |
def getAgentKey(id):
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
class Agent(BaseModel):
|
| 24 |
+
agent_id:str
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
+
class Payment(BaseModel):
|
| 28 |
+
agent_id:str
|
| 29 |
+
instruction:str
|
| 30 |
+
|
| 31 |
+
|
| 32 |
|
| 33 |
def load_keypair(agent):
|
| 34 |
|
|
|
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
+
@app.post("/payment")
|
| 66 |
+
def PaymentInstruction(Payment):
|
| 67 |
+
try:
|
| 68 |
+
velocitypayableinstance=VelocityPayableAgent()
|
| 69 |
+
velocitypayableinstance.Agent()
|
| 70 |
+
return True
|
| 71 |
+
|
| 72 |
+
except error:
|
| 73 |
+
return False
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
+
|
| 82 |
+
|
| 83 |
|
| 84 |
@app.get("/agent/{id}")
|
| 85 |
def getAgentKey(id):
|