habulaj commited on
Commit
df1e6f5
·
verified ·
1 Parent(s): f3d4dfe

Update routes/hello.py

Browse files
Files changed (1) hide show
  1. 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
- 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))
 
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))