Update routes/hello.py
Browse files- routes/hello.py +7 -5
routes/hello.py
CHANGED
@@ -40,11 +40,13 @@ def create_account(account_data: AccountRequest):
|
|
40 |
def check_onboarding(account_id: str):
|
41 |
try:
|
42 |
account = stripe.Account.retrieve(account_id)
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
48 |
|
49 |
except Exception as e:
|
50 |
raise HTTPException(status_code=500, detail=str(e))
|
|
|
40 |
def check_onboarding(account_id: str):
|
41 |
try:
|
42 |
account = stripe.Account.retrieve(account_id)
|
43 |
+
|
44 |
+
# Se 'charges_enabled' for True, o onboarding foi concluído com sucesso
|
45 |
+
if account.charges_enabled:
|
46 |
+
return {"status": "complete"}
|
47 |
+
|
48 |
+
# Caso contrário, o onboarding ainda tem pendências
|
49 |
+
return {"status": "incomplete", "reason": "Onboarding not fully completed"}
|
50 |
|
51 |
except Exception as e:
|
52 |
raise HTTPException(status_code=500, detail=str(e))
|