#cecilia-chen-_webhooks

1 messages ¡ Page 1 of 1 (latest)

glossy egretBOT
#

👋 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/1278162594699546677

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

shrewd coyote
thorn relic
#

Oh, thank you!

#

I also wonder, when we create custom connected account, we set up the payout schedule to be Daily + 3 delay days, so i wonder when the payout object will be created? on the first day when we create transfer to the connected account, or on the 3rd day after we create the transfer?

shrewd coyote
#

sorry, this isn't something that we're familiar with here on this channel. Support will be able to better advise you on that

thorn relic
#

ok

#

I also wonder, how to get the connected account's id, if using this connect account's type of webhook, i think it will return a payout object, but i want to know which connect account's payout got updated.

#

we never manually create a payout object in our code, when i create transfer object, i added some meta data into the transfer object, such as customer name, order id. it would be good if we can retrieve those data from the updated payout object

shrewd coyote
thorn relic
#

so webhook will return an event object? and we use event.account to retrieve the account's information, and use the event.data.object to retrieve the payout object?

#

if i want to retrieve the last 4 digits of the bank account that will receive the payout, i will need to use event.data.object to get the payout object first, and then use the payout object's destination attribute to get the external account, and retrieve the last 4 digits using the "last4" attribute to get the last 4 digits?

shrewd coyote
#

so webhook will return an event object? and we use event.account to retrieve the account's information, and use the event.data.object to retrieve the payout object?

yes, that's correct

#

we never manually create a payout object in our code, when i create transfer object, i added some meta data into the transfer object, such as customer name, order id. it would be good if we can retrieve those data from the updated payout object

To clarify, the metadata on a transfer object, is not populated into the corresponding payment object (py_) that is created on the connected account. If you want to see the metadata on the payment object, you need to make another request to update the same metadata on the payment object

#

if i want to retrieve the last 4 digits of the bank account that will receive the payout, i will need to use event.data.object to get the payout object first, and then use the payout object's destination attribute to get the external account, and retrieve the last 4 digits using the "last4" attribute to get the last 4 digits?

essentially yes - you can just retrieve the payout, and expand destination to make a single request (instead of 2). https://docs.stripe.com/api/expanding_objects

thorn relic
#

brilliant!

thorn relic
#

i just checked the event object, it does have a "account" attribute: The connected account that originates the event. and the type is nullable string, does it means, it is just the connect account's id, not the whole account object?

shrewd coyote
#

yes, it's just the id

thorn relic
#

When i tested it, I made a transfer to the connected account today 5:33 pm under test mode, and i see a payout object was created, with initiated time of 6:13pm, and estimated arrival date is tomorrow. Why is that? When i create the custom connected account, I set the delay-date to be 3 days, my expectation was that the payout be initiated in 3 days...

shrewd coyote
#

For such payout related questions, Support will be able to better answer that better than we can

thorn relic
#

will a charge be created if I make a transfer to the connected account?

shrewd coyote
#

yes, a transfer results in a payment (a.k.a charge) on the connected account. That created payment on the connected account will have the prefix (py_)

thorn relic
#

the desired outcome we want it that, when our platform create a transfer to the service provider on our platform, it will arrive to their bank account at least in 3 days, to handle customer dispute during this period. Our api will create the transfer once a service provider clicked the button that represents that the task has been finished. That is why we want to set the delay-days to be 3 days.

#

but when I tested the transfer today, I see the payout for the connected account become available tomorrow, which seems like a bug to me

shrewd coyote
#

can you share the transfer id?

thorn relic
#

tr_1PsZpQ07TXb9PM9QPXuffkI4

shrewd coyote
#

it doesn't affect Transfers

thorn relic
#

what does that mean? I add a on_behalf_of parameter to the transfer?

shrewd coyote
#

am I correct to say that you're using Separate Charges and Transfers?

thorn relic
#

yes, thats correct

#

our business logic is like, a customer paid 100 dollars for a house cleaning service that is scheduled at September 20, 2024. And then, a service provider come to the customer's home on September 20, 2024, and then there is a button for them to click to represents that the task is done. Once the button is clicked, our api call transfer to the service provider's connected account immediately. But we don't want the money to be moved to his bank account, until in 3 days later. because we need those 3 days to allow disputes handling.

glossy egretBOT
shrewd coyote
#

if you want to use separate charges and transfers for this, then you can't use delay_days. You should only transfer the funds to the connected account 3 days later

#

that calculation for 3 days later needs to be handled by your system