#bogdan-cli-connect-missingevents

1 messages ยท Page 1 of 1 (latest)

silver muralBOT
quartz mason
#

Taking a look at your question now

#

What's the actuall command for this?
stripe trigger payment_intent.succeeded --stripe-account ${acct_id}

Like, what's the actual account ID being set to? Is the command exactly like the above? Or are you actually manually copy -pasting in an Account ID?

rocky flume
#

i am using an actual account id so this is the command: stripe trigger payment_intent.succeeded --stripe-account acct_1MRK5HGa9JQ3EAsh

#

and acct_1MRK5HGa9JQ3EAsh is an actual account id from my stripe connect environment

quartz mason
#

That's really odd. That worked for me just fine. It processes a payment on my Connect account, which triggers a Connect event

#

That leads me to believe your listener might not be listening for that particular event

#

Are you able to see the event on the Connect account when you view their Event logs via the Stripe Dashboard?

#

You should be able to navigate directly there using this URL:

https://dashboard.stripe.com/<insert account ID here>/test/events

rocky flume
#

Yes, I can see the events if I use the URL that you sent

#

so what could be wrong with my listening configuration? this is the command that I am using in the terminal stripe listen --forward-connect-to localhost:5173/api/stripe/webhook/connect

#

i have configured the endpoint to handle payment_intent.succeded events but even if that was the issue, the request doesn't even reach the switch statement

#

I have a console log right at the beginning of the request which is not printed in the console

quartz mason
#

Let me dig a bit more

rocky flume
#

one more thing that I noticed is the following: if I use this command stripe listen --forward-connect-to localhost:5173/api/stripe/webhook/connect to listen to the events and then this command to trigger the request stripe trigger payment_intent.succeeded (without the --stripe-account flag) the request still does not reach the actual endpoint but i get some new prints in the stripe listen console as seen in the attachment

#

but if I use the --stripe-account flag, nothing pops up in the stripe listen console

quartz mason
#

Okay, that was my next question

#

So your listener is configured properly in this case right? Because it is successfully receiving the events you're triggering on the Connect account. So that must mean the endpoint you coded yourself is not actually setup to get the event correctly (I think)

#

You're running a server somewhere else to listen on port 5173 correct?

#

If so, let's take a look at the route that is handling the inbound requests and make sure that's also setup correctly

rocky flume
#

yes I run that locally in a svelte application

#

would you like to see a ss of the endpoint?

#

does the webhook endpoint need to be configured differently for stripe connect compared to regular stripe?

quartz mason
#

It's never reaching the console.log(); at the top of that function, correct?

rocky flume
#

yes that is correct, sorry for the late reply

ancient sorrel
#

Hello! I'm taking over and catching up...

rocky flume
#

on the other hand, if I use stripe listen --forward-to localhost:5173/api/stripe/webhook/connect and stripe trigger payment_intent.succeeded (so the same comands witout the connect configuration) everitying is working perfect

ancient sorrel
#

If you try again, but add --log-level debug to your stripe listen command do you get any useful output when you trigger the Event?

rocky flume
#

no, nothing happens, all i get is sending and receiving ping events

#

these are the commands : stripe listen --log-level debug --forward-connect-to localhost:5173/api/stripe/webhook/connect and stripe trigger payment_intent.succeeded --stripe-account acct_1MRK5HGa9JQ3EAsh

ancient sorrel
#

Can you give me the Event ID you're expecting to show up? Starts with evt_.

rocky flume
#

yes, should be this one: evt_3MS3HbGa9JQ3EAsh1Vr0O3CW

ancient sorrel
#

Looking...

rocky flume
#

okay\

ancient sorrel
#

If you run stripe get account does it show your platform account as expected, or a different account?

rocky flume
#

it shows the correct account

#

so the actual company account where the user linked to this id (which I am using to trigger the events) acct_1MRK5HGa9JQ3EAsh is registered at

#

I need to take the dog out, sorry, will be back in 10 min

ancient sorrel
#

Honestly I'm not sure why the Event isn't showing up. It should be based on what you've described. If you log in to the connected account using Stripe CLI and trigger an Event there without Connect does it work as expected?

rocky flume
#

i will try that, both accounts are created with the same email. could that be a problem?

#

so i am a developer on this platform that uses stripe connect so I have been added to the stripe company account

#

but I also registered to the platform using the same email so there is also a customer account under it

#

oh and one more thing, if I use stripe listen and stripe trigger without the corresponding connect specific flags, everything works perfectly

ancient sorrel
#

The same email shouldn't matter.

rocky flume
#

I tried to log in to the connected account (not the company account) with the CLI and it works if I do not use the connected flags

#

now if I use stripe listen and trigger with the corresponding connect flags, I get a slightly different response than before but still not what I would expect

#

the events are seen on the listen console but no response is giving, they are not reaching the webhook endpoint

#

so the first ss is with stripe cli loged in as the conect account while the second one is logged in as the company

warped warren
#

๐Ÿ‘‹ Taking over as Discord is extremely busy

#

Let's all look at exactly one Event: What is the Event id that is not reaching you? Also can you confirm why you are logged in two different accounts? Is this on different computers?

#

bogdan-cli-connect-missingevents

#

cc @rocky flume

rocky flume
#

brb 10 min, sorry

#

i was asked by your coleague to perform the same commands from a diferent account to see if i get the same result

#

it is two different accounts

#

same computer

warped warren
#

sounds good. Let's make sure you're logged back into the platform, that you can retrieve that account in the API and then we can go from there

#

but my current guess is basically: This account is connected in Live mode. The Event in Test mode will still only be sent to your Live mode WebhookEndpoint and nothing else.
So if you do stripe listen you won't see that Event, it'd never be sent to the Test mode connection of the CLI

rocky flume
#

yess im back, are you still here?

#

so if your assumption is correct, it means that if I deploy this endpoint and enable the webhook in the stripe dashboard, things should work right?

warped warren
#

yeah

#

as long as you have a Live mode WebhookEndpoint

#

you will not get the Event on the Test mode Webhook Endpoint because the account is only connected in Live mode. It's a pretty annoying limitation sadly ๐Ÿ˜ฆ

rocky flume
#

ohhh I understand. okay then, thank you for your extended support effort!!

warped warren
#

Sure thing, sorry this was so confusing!