#oxmarco_connect
1 messages · Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- oxmarco_code, 18 hours ago, 57 messages
👋 Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1247462639869755410
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
Hey, I think I found a problem with my code on the way it handles the account.update webhook
if (event.data.object.details_submitted && event.data.object.payouts_enabled
) {
if (
event.data.object.capabilities.card_payments &&
event.data.object.capabilities.transfers &&
event.data.object.charges_enabled
) {
// save the user as stripe verified
} else {
// throw an exception
}
}
Hi
What is the ask exactly here ?
first of all, is. the nested "if" needed?
secondly, what if the account update instead of going from unverified to verified goes vice versa, should I handle that scenario too?
What is your use case first
a stock images marketplace, I am using Stripe connect
return await this.stripe.accounts.create({
email,
controller: {
losses: {
payments: 'application',
},
fees: {
payer: 'application',
},
stripe_dashboard: {
type: 'none',
},
requirement_collection: 'application',
},
capabilities: {
card_payments: {
requested: true,
},
transfers: {
requested: true,
},
},
business_type: 'individual',
business_profile: {
mcc: '5815', // digital_goods_media
url: `url`,
},
tos_acceptance: {
date: Math.floor(Date.now() / 1000),
ip,
},
});
users register first
then I generate onboarding links
return await this.stripe.accountLinks.create({
account: stripeAccountId,
refresh_url: 'https://example.com/verified?success=false',
return_url: 'https://example.com/verified?success=true',
type: 'account_onboarding',
});
secondly, what if the account update instead of going from unverified to verified goes vice versa, should I handle that scenario too?
1- You need to keep listening toaccount.updatedevent
2- Immediately after creating an account, check the Account object’s requirements.currently_due attribute for any additional requirements.
3- Continue watching for account.updated event notifications to see if the requirements hash changes, and reach out to your user for additional information as needed.
there are quite a few fields on the account.update webhook bag, what should I be watching closely? pending_verification ? or payouts_enabled?
You need to watch requirements.currently_due attribute to see if there is any additional required information
Otherwise, here are all the checks that you can do in order to see if a verification is needed or not:
https://docs.stripe.com/connect/handling-api-verification#determine-if-verification-is-needed
ok, just to be sure, if one of these fields is invalid, can I just call stripe.accountLinks.create again?
and Stripe will take care of the user verification
Yes you can use Stripe hosted onboarding to handle new requirements becoming due:
https://docs.stripe.com/connect/hosted-onboarding#handle-new-requirements-becoming-due
And you can create an Account Link with the due fields:
https://docs.stripe.com/connect/hosted-onboarding#create-account-link
ok looking at the schema, I should check if the past_due and the currently_due arrays are empty, if they are both empty then the user has been successfully onboarded, otherwise I need to redirect them to the onboarding link
Yes!
excellent, but are you sure then event.data.object.capabilities.card_payments, event.data.object.capabilities.transfers and event.data.object.charges_enabled will be enabled? or do I need to check it specifically
I may need to do both to be honest
You can add an additional checks, it's ok yeah.
ok perfect, one last thing
got wrong question, I am sorry, here is the correct one
I see that connected accounts balance is split into available and pending, but it should be paid directly to the connected account iban. So what is the "available" balance representing then?
my reading is that the available balance is what will soon be transfered to the connected account IBAN and once that happens, it is reset to 0
The "available" balance represents funds that have been processed and cleared from the Stripe platform and are ready to be paid out to the connected account's bank (IBAN). These are funds from successful charges that are no longer in a 'pending' state due to transaction processing times or potential dispute holds.
On the other hand, the "pending" balance represents funds from transactions that have been processed but not yet cleared. These funds might not be accessible immediately due to possible delays in processing transactions. The delays can be due to bank processing times or additional time held by Stripe to mitigate risks like refunds and chargebacks.
👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
oxmarco_connect
hi
yes it's not clear if the "available" balance is reset after a payout or not
say I have $10.00 in the pending balance, then after a few days I'll see these in the available balance, then what happens?
the available balance contains both the balance that is available in your Stripe Account and the balance that will be paid out next
if there's no other funds that are entering your balance then yes
but in normal cases you would rarely see a 0 available balance
ok perfect
is there a way to speed up pending -> available -> payout transition in test mode?
yes
ok great
one last thing, I would like to do some production testing
is there a way to wipe out the data on prod?
we don't recommend doing that at all
there are risk factors with Stripe and with the issuing banks flagging you as a potential fraudulent risk
ok I assumed that, the main problem I see is no matter what, a prod env is always different from a testing env
not really
not doing any prod testing seems just wrong from an engineering perspective
at least not from Stripe's perspective
you can test your flow without getting payments through
that's the part that we don't advise you to do
we know that if you're integrating correctly in test mode with Stripe the same behavior will happen in livemode
which kinda breaks the point of live testing haha
I will keep trying in testmode then, thanks for flagging it
sure let me know if you need any more help
just one confirmation
stripe.balance.retrieve -> returns the available and pending balance
stripe.payouts.list -> returns the bank transfers
yes exactly
ok that was all, thanks again for sticking with me
I feel like a few code examples on the Stripe documentation website would really help
happy to provide you code snippets from our several discussions
thank you for your feedback