#deland_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ 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/1315813346313895956
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Basically I want to:
payout.created - Create an entry in my database & save a uid in payout metadata for referencing in future events
payout.updated - Update database entry and send the appropriate push notification such for when a payout status is pending paid in-transit failed etc
If you have any best practices to recommend I'd appreciate it too
Hi, this is expected in test mode and there is not a way to test this like you mentioned above. Also, please note that event ordering is not guaranteed and we document it here: https://docs.stripe.com/webhooks#event-ordering
Got it, what would you recommend I do? What are the events I should listen to? At the very least I want to:
- Notify customer their payout has initialized & create an entry in my database
- Notify customer their payout has been paid/completed & update my entry
I can deal with the async issue. But the documentation on what payout.updated tracks is conflicting. A thread on this discord said that payout.updated only triggers when status changes from pending to in-transit
Reference - #1225160449402601502 message
You can listen to https://docs.stripe.com/api/events/types#event_types-payout.created event when it's created. Then, you can listen to https://docs.stripe.com/api/events/types#event_types-payout.paid which occurs whenever a payout is expected to be available in the destination account. In cases when payouts fail, you'd listen to https://docs.stripe.com/api/events/types#event_types-payout.failed. There are numerous reasons as to why you might get payout.updated like the payout transition from pending to paid status, or when a trace id for the payout is available: https://docs.stripe.com/payouts/trace-id#api
You can listen to payout.paid event in this case to know when the payout is paid.
Oh so if i don't care about trace IDs, i can ignore payout.updated?
That is up to you. Since you only care if the payout is paid or failed, it sounds like you can.
And is payout.failed necessary? I see that payout.paid can contain both failed and paid statuses
What do you mean by that? Where do you see it? Can you share the event id with me? Where are you looking?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I might be misunderstanding. But when i trigger a failed test payout, payout.paid also gets the failed status
No, that just describes the behavior. You can listen to payout.paid and this event will be sent. If the payout fails, a separate payout.failed notification is also sent, at a later time.
Does that mean i can use payout.paid for both successful and failed payouts? It only triggers when it's "expected" to be available at the destination account.
So if it fails before the "expected" available date, will it trigger immediately? Or will a payout.failed event occur in place of it.
It says that "a seperate payout.failed notifciation will be sent at a later time" which is a bit confusing
Makes me assume that if it fails before the expected available date, payout.failed gets sent immediately. And then when the expected available date hits, payout.paid triggers and an additional payout.failed event is sent at a later time.
No, you would want to listen to both
You should not see payout.failed before payout.paid. You would get payout.paid first... then if it fails you get payout.failed.
# Send 'Payout Paid' alert
if payout_status == "paid":
NotifyHostPayoutPaid(host_id, payout_id, payout_amount_dollar_string, payout_destination_formatted)
# Send 'Payout Failed' alert
elif payout_status == "failed":
NotifyHostPayoutFailed(host_id, payout_id, payout_amount_dollar_string)
# Capture a payout issue for Sentry tracking
logging.exception(
f"Payout failed (payout.paid event) for payout ID: {payout_id} | payoutErrorCode: {payout_error_code}"
)
I sent a failed payout on the dashboard. payout.paid gets both paid and failed statuses
Can you share the event id please?
What does 'payout.paid gets both paid and failed statuses' mean?
The payout object that payout.paid event holds can have paid and failed as the status's value
Let me grab the event
evt_1QUGipPPpHfUvljySOV60HAo
Ahh, you're referring to the status field on that event. Yes, that is expected: https://docs.stripe.com/api/payouts/object#payout_object-status. However, some payouts that fail might initially show as paid, then change to failed. So you'd want to listent to both events.
So how do i make sure I don't send the wrong alert to my customers?
you can look at the status on the event
Yes but if it can change from paid to failed?
You listen to payout.paid and look at the status. If it's 'paid' send your notification. If the status is 'failed', you do not. In some cases, payout.paid can have status 'paid' , you let your customer know anyways but you might get a separate payout.failed. In this case, you send another notification that the payout failed.