#BrianC-CLI
1 messages ยท Page 1 of 1 (latest)
Hi there! Yeah you should be able to trigger Connect webhooks using the --stripe-account flag: https://stripe.com/docs/cli/trigger#trigger-stripe_account
And the checkout.session.completed webhook should be supported on the CLI... what issue are you hitting?
We are locally testing a payment session to a connected account. The only webhook we get back when testing locally is application fee processed. We need to get the checkout.session.completed event back. There does not seem to be an option to add connected event back to the webhook (unlike non-local calls where you can specify the hooks sent). Also, the limited list of triggers does not include chckout.session.completed which even if we manually triggered wouldn't help as we are testing senging and return metadata with the call.
Do you have a Connect Webhook endpoint set up?
Sounds like you only have a Direct endpoint
to sum up, we need to know how to get conneted account events sent back as well using the CLI localhost
Which is why you are only getting the app fee event
A Connect endpoint set up where? We are testing locally from the master account
There is not way to set up a localhost return webhook without CLI correct>
?
When you go to your Dashboard here: https://dashboard.stripe.com/test/webhooks what type of endpoint do you have set up?
Yes you use the CLI to forward to your local endpoint
We have our normal test server (remote) endpoints set up and one local listener webhook event for the localhost.. I'm nost sure if I am understanding what you are referring to other than thatm.
Can you provide your account ID?
There is a column on that page in the Dashboard that is titled "Type"
For each endpoint it should either say "Direct" or "Connect" under that column
If you are attempting to listen to events on your Connected Account, you need a "Connect" type endpoint. It sounds like you currently only have set up a "Direct" type endpoint.
See that screenshot from the docs for an example
But the hosted endpoints are not for localhost testing correct?
You can use the CLI to forward to those endpoints.
Okay sorry, I think I'm wrong and misremembering.
One second, let me check myself, might just be moving too quickly. Haven't played with CLI in a while.
Yes, I think you are mistaken. Essecntially we need the CLI to send connected account events
Yes okay sorry, I forgot you do this all from the CLI
Okay so there are two steps here.
CLI is the only way to test localhost, correct?
Yes
OK. We need connected account events to be sent when using CLI
So first when you use stripe listen you want to set the --forward-connect-to flag
This will forward Connect events to your local endpoint
Then you can either trigger Connect events via the CLI as well using the --stripe-account flag to make an event be a Connect event. Or you can just trigger them regularly (sounds like you want to send metadata so you wouldn't use CLI)
Is that an undocumented feature? It is not in the docs
It is in the CLI reference which is public and I linked you too.
Not all of the options in the CLI Reference are in the public docs
It's not on that page you sent
I'm looking at it publicly?
Huh when I access the URL above it places me just below that flag
Ah! I see it. anchor wsn;t workgin
Slide up slightly?
Yeah sorry... looks like the anchor isn't taking into account the page header ๐ฆ
That looks like what we need. Thanks!
Yep sorry for the initial confusion!
The forward-connect-to flag does not seem to be working. stripe listen --forward-connect-to https://localhost:44380/webhooks/stripeconnect. but still only receiving application fee created event. Could it be a caching issue from the previous setup?
I don't think so. Let me test it real quick on my end
Webhook is failing for some reason. I'm seeing it in the test account. It shouldn't be and no further info given. Fails on retry too. Something is amiss
Hello! I'm taking over and catching up...
Can you show us a screenshot of what you're seeing from the stripe listen command you're using?
The Dashboard does not show Stripe CLI webhook activity, so you should not be looking there. The information in your Dashboard screenshot indicates you have an actual Webhook Endpoint set up that is not properly responding to the Events we're sending to it, which is entirely separate from Stripe CLI.
understood but to show where I am in the debugging process
Can you give me the ID of an Event you expected to show up there?
it's in the first screenshot the one that is listed as pending a response
cs_test_a1cwHknGBWuSOyG0wxNDlGipPg8gVcjCzJWfpJIPndQPcTPASEWew45pdD
I don't believe the ID of the event is shown in the screenshot.
It would start with evt_
It should be visible if you click on the Show event detail link there.
evt_1KqnRaQSv5bgTx2G2xCeR81P
Looking, hang on...
It looks like you're creating Checkout Sessions on an Express account, which is not recommended. Direct charges should be used with Standard accounts, not Express accounts.
I don't think that's the cause of this particular issue, just mentioning it as it's pretty important. ๐
Still looking for the cause of the CLI issue...
OK. Thanks for the tip. We will look into that. The other connect accounts we use this with are indeed Statndard accounts.
To clarify, you started the stripe listen command above and then triggered the Event? Not the other way around?
yes
you will see that the application_fee,created hook was sent for that transaction but not the connet event
It looks like all of these things happened on the same second. If you trigger an event a few seconds after stripe listen does that make any difference?
the event is being sent via our app. no control over the spacing of the timing.
either way, the cli is still listening. should we try it agian from the app?
Yeah, give it another try.
ok stand by
To clarify, I mean it seems like you started stripe listen on the same second as both of these Events.
no. we started the listen and then went to the app and triggered it. is it possible there were retries from pervious? We'll find out in a second...
There are no retries with Stripe CLI, only real Webhook Endpoints will receive retries.
OK. we just sent two more transactions and doesn't look like any webhi=ook events sent back now. transactions are showing up in datshboard
looks like locallistener got disconnected. will connect again and repeat
ok connected again and sending transaction ghrough app
same thing. only received the application_fee.created
--forward-connect-to does not seem to be working
Okay, let me do some digging, give me a few minutes...
๐
Can you stop the current command, then try again with just stripe listen (with no parameters)? By default stripe listen should listen for Events from both your account and connected accounts, with Connect Events showing up as indicated in this screenshot from the test I just ran to confirm this is working as expected for me:
I first created a Customer on my own account, then a different Customer on a connected account.
I want to see if this works or not first, then we'll go from there. ๐
ok
I'm not understanding. It's listening and we created event from app and as expected , nothing back. There is no use in triggering manually as we can simply read the responses in the dashboard. Make sense?
So you ran stripe listen and triggered an event on a Connected account and didn't see it show up?
triggered an event from our localhost app and of course nothing back
Okay, so something is wrong with Stripe CLI. Can you upgrade to the latest version of Stripe CLI and try again?
OK. I have to run now but will try later. If it doesn;t work, do you have any suggestions other than ngrok (we had security issues with that) for a 3rd party solution. Just need to get this tested and have spent a few hours on it so far ๐
The next step after upgrading would be to run stripe listen --log-level=debug and then trigger an event on a connected account and see what the debug output says.
OK. Thanks1
If the upgrade doesn't fix it please come back here and ask about the debug output in #dev-help if this thread is archived. ๐
Upgraded CLI to latest version. Same issue. only returning application_fee.created
OK
Hmm so even the regular stripe listen didn't work?
we are talking about
So you ran stripe listen and triggered an event on a Connected account and didn't see it show up?
no
I mean yes.
What is the question?
Yes, ran /stripe and triggered an event and connected account event not being sent. Using listen --forward-connect-to not workjing either. It's all in the thread. Ran debug and have that if you want to look but look slike same thing. Connected events not being sent to CLI
REgular Stripe listen didn;t work
I see. Can you give me the newest event id? evt_xxx
Master account
For example, a working forward would look like this
And in your Dashboard https://dashboard.stripe.com/test/webhooks
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You should see something like
Yes, I know what it all looks like. I'm telling you it's not properly sending connect events to the CLI. Have been working on it for hours now. Do you want the debug session?
I just want to make sure we are on the same page. Sorry if that was confused. Let me clarify a bit more to fully grasp the context
So you upgraded the CLI to latest version, do a listen --forward-connect-to your localhost, and triggered a connected event, and it's not received, correct?
Yes, It's all in the thread.
it's not received with just stripe listen or with stripe listen forward-connect-to
Yeah I read the thread. I want to know if my colleague suggestion made a different
stripe listen should listen for Events from both your account and connected accounts, with Connect Events showing up as indicated
So in your latest test/newest Stripe CLI version, which event did you trigger?
from our app send a transaction triggering the checkout.session.completed on a connected accoutn but we only receive the application fee event from the master account
we have tried evryting suggested multiple times. the last sugesiton was to listen with debug enabled. same result as above
Can you give me the event id of that latest checkout.session.completed please?
evt_1KqpnrQSv5bgTx2G2LWkrnvm
Perfect, let me look at it closer
BRIANCAMELI882B Dos this make sense to you as your local listener PC name?
yes
It looks like the webhook being sent from the master application is working but the webhook being sent by the connect account is being returned a 500 error
application fee webook id from the master account id is fee_1KqpnpQSv5bgTx2GlrpSAfib
Looks like an internal error on Stripe's end as one webhook is processing properly and the other is not making to the endpoint
To clarify, where do you see this?
is being returned a 500 error
on the event details page for the event id I gave you.
in the dashboard.
Look, i know you guys work really hard and I appreciate your help in debugging this but I need a solution quickly. It has derailed my dev for about 5 hours now. If it's not obvious to you please let me know and perhaps suggest a 3rd party solution. (other than ngrok) that we can use to complete this simple test and move on. Much appreciated.
I think there are multiple thing mixed up and I am trying to get you clear about it
the 500 error is not from Stripe. It's your server, specifically "https://artistshare.com/webhooks/stripeconnect" returned 500 for our request. A Webhook event is a Stripe request sent to your server
Web site created using create-react-app
But it has nothing to do with the CLI
Seemingly it wasn't sent to the listening CLI
OK. thanks. How do we test webhooks locally using the CLI when our localhost application send a charge to a connected account?
That's all we need to know. The instructions in the docs don't seem to work.
I started this thread more than 4 hours ago ๐
I know it's draining your time, apology, but debugging is the fastest way to get through it. It's development in the end :/
Not development for us ๐ it's debugging Stripe tools it seems.
How do we test webhooks locally using the CLI when our localhost application send a charge to a connected account?
I believe stripe listen should work, so as my colleague. But since you are having issue I want to make sure the more simpler version is working
Stripe listen works but connect webhooks are not sent. Only the master account
webhooks
adding the forward-connect-to flag is what the docs say is the solution, as did two of your colleagues but that is not working for some reason
An alternative way to testing localhost is what we should do at this point since the CLI does not work, agreed?
We can't reproduce the issue, as my colleague tried in a screenshot above #966475442586529793 message
You are not reproducing correctly I think. We are not manually triggering events through the command interface. Our localhost applicatiopn is sending a transaction. It would be different test, correct? Do yuo uhave a setup to have an app rumnning on a locahost server to exactly reproduce the scenario?
It's also a create customer call , not the event we are sending. Lots of differences
I triggered via an application
Yes my app running on local, I do a stripe listen forward to it (regular forward). I triggered a PaymentIntent from my app
Ok. Then what are the differences? Clearly something is off.
I am going to try a Checkout Session
OK. Let me know what happens...
Here, it's working on my end
That's a Checkout Session completed on a Standard Connected Account's Direct Charge
Q: You said the 500 error being returned by the test webhook was being returned by our server.. "the 500 error is not from Stripe. It's your server, specifically "https://artistshare.com/webhooks/stripeconnect" returned 500 for our request. A Webhook event is a Stripe request sent to your server". That is not our localhost server but our production server URL. Why is a test webhook being sent to our production server?
Web site created using create-react-app
A test event can be sent to a Live Webhook. It's expected but a different story and I didn't want to go into detail to confuse you more
I think maybe the Connected Account type matters (Express vs Standard)
Why would a test event be sent to our live server though? that could cause problems with our database if it gets processed?
Your colleague before you said the Express/Standard probably would not be causing it.
What version of CLI are you using? It seems to be an older version.
hat could cause problems with our database if it gets processed
Recommend to check thelivemodeparameter comes along. It's a long historical story why we are doing that. I really hope we can unship it in the future to avoid confusion
What version of CLI are you using? It seems to be an older version.
Yeah I am thinking of upgradding it. But I think it doesn't really matter
trying again with an express/ direct charge. It's a discourage pattern to mention
Hmmm. Doesn't matter? Considering we've been hacking at this for hours with no avail I think being a little scientific might help. don't you think? I understand about the Express/Standard but it is not recommended for business purposes.
What version are you using so we can match it on this side?
OK. We will get 1.8.3 and test if 1.8.6 doesn't work for you
1.8.6, listen and forward normally to localhost, triggered a Checkout Session, direct charge, to an Express connected account
OK. So our exact setup and scenario but we are not receiving the webhook from connect account and it doesn't look like it's being sent from Stripe. I'm out of ideas.
Express was not the issue. nor the CLI version. Our checkout session requests are properly formatted. It is not on our end that I can see.
You are not using the the forward-connect-to and it is returning connect account webhooks? How does that wortk?
because normal forward should also forward both normal and connect events, like my colleague said
I am going to try forward-connect-to
Where is the application_fee webhook from your master account then?
if it is returning all "normal" and connect events? Is normal the master account?
yeah normal is the master account (platform account). I am adding that application fee setting to try again
Here
Are you seeing the connect webhooks being sent to our localhost? I understand you can get it to work on your end but at this point it
s a black box for us. Nothing on our end that we can tell is incorrect. We are not getting the same responses as you
No I don't. I don't see your event sent to your local instance. Sorry for an obv question, but did you start the listening when triggered the event?
Can you show me some screenshot?
The screenshot is int he thread multiple times. Yes, of course
Ok. I'm throwing in the towel. It's just not working. No way to test this on localhost using the CLI. Didn't want to have to resort to ngrok but going to have to at this time. Thanks for your help
Can we have a screenshot with latest Stripe CLI version?
Sorry for to hear that. I think it could be an issue with Stripe release on window ๐ค
That's the last diff point between my test and yours
The last screenshot I sent of this to Rubeus has it with the latest version. We already upgreaded and ran these tests hours ago.
At this point there is no differences
It has to be something on Stripe end. Nothing else to try. Thanks
This one? #966475442586529793 message
No. Not that one. Maybe we didn;t send a screenshot but we've already upgraded and tested multiple times. Thanks again
Hey, we are happy to help if you willing to continue here. I will try to find if there is similar report. Let us know anything else that could help you
You can also ask another different ppl to test this (triple check) for you
@clever timber I just found smth: https://github.com/stripe/stripe-cli/issues/600#issuecomment-903106835 It seems to have issues with Window CLI. Could you double check firewall as this comment?