#kevin_connect-webhooks

1 messages ยท Page 1 of 1 (latest)

proper monolithBOT
#

๐Ÿ‘‹ 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/1249838550699085844

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

limpid rose
#

Hi there

weak inlet
#

Hello

limpid rose
#

What do you mean exactly by "doesn't fire up"?

weak inlet
#

first, I can't find those events in the log

#

second, the functions didn't get triggered in the code after case "charge.succeeded" as well as case "checkout.session.completed"

#

even though, the payments went through and I can see them in the log

#

btw, it worked when we did testing by forwarding the request to local host

limpid rose
#

Okay, the event you shared is application_fee.created. I don't see any webhook that is listening for this event type, so this event wasn't sent to any endpoints

#

Which charge.succeeded or checkout.session.completed events were you expecting to receive?

#

Ah, I think I found them

weak inlet
#

is the end point for processing the application fees

limpid rose
#

Okay, I see a charge.succeeded event was delivered successfully to the endpoint .../api/listingWebhook but delivery attempts to .../api/connectWebhook failed

weak inlet
#

ok, these payments are supposed to go through the connectWebhook only, because it's not related to listings

#

do you know why delivery attempts fialed at the connectWebhook? it works well when we did testings

limpid rose
#

both listingWebhook and connectWebhook were configured to listen for charge.succeeded events, which is why we're sending to both

weak inlet
#

ok, but we build different payment pages for each of these two, one is for listing, and another is for connect

limpid rose
weak inlet
#

I'm using the same authentication on both webhooks, so one is working and the other isn't

limpid rose
#

Hm, authentication. In order for events to be delivered, your endpoint should be publicly accessible

weak inlet
#

thanks, I will look into the accessiblilty, but why can't I see these events in the log, even if they are failed

limpid rose
#

You're referring to logs in the Dashboard or something else?

weak inlet
#

and how can I send these events separately for each webhooks, there are two kind of charges

limpid rose
limpid rose
weak inlet
#

here is what I see on my end

limpid rose
#

Ah, okay, you're using Workbench

weak inlet
#

yeah, how can I get out of Workbench

limpid rose
weak inlet
#

I don't think I have time to learn it yet

weak inlet
#

I don't think that's the case when we did tests on localhost

limpid rose
#

What do you mean by "two different charges" exactly?

weak inlet
#

we have two different checkout pages built from Stripe checkout, for two different purpose

limpid rose
#

As in there are two different Prices used for those Checkout Sessions?

weak inlet
#

two different checkout URLs, different prices, different line_items

limpid rose
#

Got it. That won't matter since the events triggered by those actions will be the same: charge.succeeded, checkout.session.completed. It'll be up to your webhook handler code/logic to parse the checkout.session.completed event to look at the line_items for that particular event

weak inlet
weak inlet
#

why can't I see these events in the log though?

#

doesn't matter if it's successfully delivered or failed

limpid rose
#

Now that you've turned off Workbench, type evt_3PPnSiF9VtVx6MBB2G9BE4GK into your search bar in the Dashboard and select "Jump to event..."

weak inlet
#

ok, I'm talking about this event evt_1PQF4xF9VtVx6MBBZENOMrHP

#

the event you referred actually sent to the right webhook and successed

limpid rose
#

Stripe didn't deliver evt_1PQF4xF9VtVx6MBBZENOMrHP to any webhooks because none of the enabled, live mode webhooks on your account are configured to receive application_fee.created events

weak inlet
#

give me a second, let me check the enabled webhook events for this webhook which generated this application_fee

#

the webhook listens to these 6 events, which generated this application_fee

#

now, the application_fee is successed, but the webhook events never triggered and logged

#

that's where I'm confused

limpid rose
#

application_fee.created events are another Event type, like account.updated and the other five in the screenshot above. Since application_fee.created isn't in the list above, we never send events of this type to this endpoint. Does that make sense?

weak inlet
#

yes, but without charge.succeeded and check.session.completed, there won't be any applicaiton_fee.created

#

the application fee is part of the charge occured

#

and it worked as expected during our testings in localhost

limpid rose
weak inlet
#

these are from the same checkout page

limpid rose
#

Okay, let's pause to make sure we're on the same page.

#

Can you restate your question in 1-2 sentences and let me know where you're blocked/what's unclear?

weak inlet
#

ok, let me clarify as much as I can

#

we are working with connect standard accounts and use a checkout page from Stripe to process payments for these connect accounts,

#

once a customer is charged, means, charge.succeeded and checkout.session.completed, we take part of the charge as application_fee

#

now, in the log, we only see application_fee, but don't see charge.succeeded and checkout.session.ompleted

#

and our webhook for these transactions never received the feedback for these charges regarding charge.succeeded and checkout.session.completed

#

so our functions to further process these payments never got triggered

limpid rose
#

And things are not working as expected in live mode, correct?

weak inlet
#

yes

limpid rose
#

I think the issue here is that there are no live mode Connect webhooks.

#

There are two types of webhook endpoints :

  • Account webhooks: these are used to listen for events that happen on your platform account
  • Connect webhooks: these are used to listen for events that happen on your connected accounts
#

Your platform has a single Connect webhook configured but it's for test mode events only and it's currently disabled.

weak inlet
#

I have two webhooks here

limpid rose
#

Right, and both are "Type: Account"

weak inlet
#

oh..... I see

#

I need another webhook for connected account?

limpid rose
#

Yep!

#

Connect type webhooks will receive event payloads that include an account property. This will let you determine which standard account that particular action was triggered on

weak inlet
#

oh, I found it

limpid rose
#

If you toggle "test mode" in your Dashboard

weak inlet
#

one question, can I change the webhook type from account to connect then?

#

or do I have to setup a new one

limpid rose
#

No, you'll need to create a new endpoint on Stripe (via the API or Dashboard) but you could use the same URL for it.

#

If you go this route, it could get messy if you don't disable the old account webhook on Stripe first or if your webhook handler logic isn't ready to receive the Connect-type payloads

weak inlet
#

Got you, thank you so much! let me dig into it, I will probably process differnet events on these two types of webhooks, but thank you! you are obviously a pro ๐Ÿ˜„

#

Have a great day there!

limpid rose
#

You too! Glad to help ๐Ÿ™‚

proper monolithBOT
graceful cove
#

kevin_connect-webhooks

weak inlet
#

ok, when using dashboard to create a webhook, I don't see anywhere where I can choose Type, either for Account or Connect

#

how to set the type to Connect when setting up a new webhook?

graceful cove
#

what do you see when you click on "Add endpoint"?

weak inlet
#

there is no options to choose webhook types

graceful cove
#

it's right there in the middle with the Listen to option

weak inlet
#

those are events that needs to be listened to

graceful cove
#

no?

#

in the middle of your picture on the left there's literally a radio button asking if you want Events on your own account or connected accounts

weak inlet
#

ah, see it now, haha, sorry

graceful cove
#

All good, this is not the best UX. I have given that feedback before ๐Ÿ˜…

weak inlet
#

I don't know how I missed that

graceful cove
#

If you ask me it should be a multi-screens flow and the first one would be that question

weak inlet
#

Thank you very much, all good, it's my bad lol

graceful cove
#

Happy to help. Genuinely I explain this once a month minimum and I'm just one person on this server. Such a weird UI we picked here ๐Ÿ˜ฆ

weak inlet
#

Thanks man, you guys are truely helpful here

graceful cove
#

thank you ๐Ÿ™‚

weak inlet
#

I think the simpliest update would be change the label from "listen to" to "type", since it says type when we look at the webhook list

#

but it's all good

#

Have a wonderful week there