Update routes/hello.py
Browse files- routes/hello.py +13 -0
routes/hello.py
CHANGED
@@ -36,6 +36,19 @@ def create_account(account_data: AccountRequest):
|
|
36 |
except Exception as e:
|
37 |
raise HTTPException(status_code=500, detail=str(e))
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
### **2️⃣ CREATE ACCOUNT LINK FOR ONBOARDING** ###
|
40 |
class AccountLinkRequest(BaseModel):
|
41 |
account_id: str
|
|
|
36 |
except Exception as e:
|
37 |
raise HTTPException(status_code=500, detail=str(e))
|
38 |
|
39 |
+
@router.get("/check_onboarding/{account_id}")
|
40 |
+
def check_onboarding(account_id: str):
|
41 |
+
try:
|
42 |
+
account = stripe.Account.retrieve(account_id)
|
43 |
+
|
44 |
+
if account.requirements.currently_due:
|
45 |
+
return {"status": "incomplete", "pending_requirements": account.requirements.currently_due}
|
46 |
+
|
47 |
+
return {"status": "complete"}
|
48 |
+
|
49 |
+
except Exception as e:
|
50 |
+
raise HTTPException(status_code=500, detail=str(e))
|
51 |
+
|
52 |
### **2️⃣ CREATE ACCOUNT LINK FOR ONBOARDING** ###
|
53 |
class AccountLinkRequest(BaseModel):
|
54 |
account_id: str
|