#magnus_unexpected

1 messages ¡ Page 1 of 1 (latest)

fossil depotBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1353839884070031531

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

raw verge
#

This is my code: const account = await stripe.accounts.retrieve(agencySnapshot.get('stripeAccount'));
if (!account.details_submitted || !account.payouts_enabled) {
stripeInvalid = true;
}
if (account.requirements?.currently_due?.length !== undefined && account.requirements.currently_due.length > 0) {
stripeInvalid = true;
}

narrow prairie
#

Hi there

#

Can you provide more details on what you mean by "open dues" exactly?

raw verge
#

The tasks which stand on top of the connected account overview like accepting the terms etc.

#

The reason why the connected account has the status "restricted"

narrow prairie
#

Got it

raw verge
#

okay so checking for payouts enabled and details submitted is useless?

#

and instead I should check if the past_due array is empty or not?

#

or should I check for the errors array?

narrow prairie
#

You should look at both past_due and currently_due, as well as whether requirements.errors is empty or not and whether requirements.disabled_reason is not null

raw verge
#

can you give me a code example when I should display the user an error message? Like my example I posted above

narrow prairie
#

Then define your logic based on that

raw verge
#

thank you!

remote rock
#

hello

#

I need help @narrow prairie

fossil depotBOT
#

@remote rock looks like you're in the wrong place, this thread is for someone else's question.

Note that posting inappropriate messages in other people's threads is against the rules. No worries if this was just an honest mistake, but anyone who violates the rules multiple times will be removed from this server.