#BrianC-CLI

1 messages ยท Page 1 of 1 (latest)

lucid siren
#

And the checkout.session.completed webhook should be supported on the CLI... what issue are you hitting?

clever timber
#

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.

lucid siren
#

Do you have a Connect Webhook endpoint set up?

#

Sounds like you only have a Direct endpoint

clever timber
#

to sum up, we need to know how to get conneted account events sent back as well using the CLI localhost

lucid siren
#

Which is why you are only getting the app fee event

clever timber
#

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>

#

?

lucid siren
#

Yes you use the CLI to forward to your local endpoint

clever timber
#

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.

lucid siren
#

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

clever timber
#

But the hosted endpoints are not for localhost testing correct?

lucid siren
#

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.

clever timber
#

Yes, I think you are mistaken. Essecntially we need the CLI to send connected account events

lucid siren
#

Yes okay sorry, I forgot you do this all from the CLI

#

Okay so there are two steps here.

clever timber
#

CLI is the only way to test localhost, correct?

lucid siren
#

Yes

clever timber
#

OK. We need connected account events to be sent when using CLI

lucid siren
#

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)

clever timber
#

Is that an undocumented feature? It is not in the docs

lucid siren
#

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

clever timber
#

It's not on that page you sent

lucid siren
#

I'm looking at it publicly?

#

Huh when I access the URL above it places me just below that flag

clever timber
#

Ah! I see it. anchor wsn;t workgin

lucid siren
#

Slide up slightly?

#

Yeah sorry... looks like the anchor isn't taking into account the page header ๐Ÿ˜ฆ

clever timber
#

That looks like what we need. Thanks!

lucid siren
#

Yep sorry for the initial confusion!

clever timber
#

No worries. We got it!

#

login

clever timber
#

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?

lucid siren
#

I don't think so. Let me test it real quick on my end

clever timber
#

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

calm fern
#

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?

clever timber
#

yes, sending now....

#

only getting the master account webhooks it looks like

calm fern
#

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.

clever timber
#

understood but to show where I am in the debugging process

calm fern
#

Can you give me the ID of an Event you expected to show up there?

clever timber
#

it's in the first screenshot the one that is listed as pending a response

#

cs_test_a1cwHknGBWuSOyG0wxNDlGipPg8gVcjCzJWfpJIPndQPcTPASEWew45pdD

calm fern
#

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.

clever timber
#

evt_1KqnRaQSv5bgTx2G2xCeR81P

calm fern
#

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...

clever timber
#

OK. Thanks for the tip. We will look into that. The other connect accounts we use this with are indeed Statndard accounts.

calm fern
#

To clarify, you started the stripe listen command above and then triggered the Event? Not the other way around?

clever timber
#

yes

#

you will see that the application_fee,created hook was sent for that transaction but not the connet event

calm fern
#

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?

clever timber
#

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?

calm fern
#

Yeah, give it another try.

clever timber
#

ok stand by

calm fern
#

To clarify, I mean it seems like you started stripe listen on the same second as both of these Events.

clever timber
#

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...

calm fern
#

There are no retries with Stripe CLI, only real Webhook Endpoints will receive retries.

clever timber
#

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

calm fern
#

Okay, let me do some digging, give me a few minutes...

clever timber
#

๐Ÿ‘

calm fern
#

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.

clever timber
#

I can try now

#

how will it know to forward the webhooks to my local server though?

calm fern
#

I want to see if this works or not first, then we'll go from there. ๐Ÿ™‚

clever timber
#

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?

calm fern
#

So you ran stripe listen and triggered an event on a Connected account and didn't see it show up?

clever timber
#

triggered an event from our localhost app and of course nothing back

calm fern
#

Okay, so something is wrong with Stripe CLI. Can you upgrade to the latest version of Stripe CLI and try again?

clever timber
#

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 ๐Ÿ™‚

calm fern
#

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.

clever timber
#

OK. Thanks1

calm fern
#

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. ๐Ÿ™‚

clever timber
#

Upgraded CLI to latest version. Same issue. only returning application_fee.created

cunning plank
#

๐Ÿ‘‹

#

Give me a few mins to catch up

clever timber
#

OK

cunning plank
#

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?

clever timber
#

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

cunning plank
#

I see. Can you give me the newest event id? evt_xxx

clever timber
#

Can you be more specific?

#

From which account. the master or the connected account

cunning plank
#

Master account

#

For example, a working forward would look like this

#

You should see something like

clever timber
#

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?

cunning plank
#

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?

clever timber
#

Yes, It's all in the thread.

#

it's not received with just stripe listen or with stripe listen forward-connect-to

cunning plank
#

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?

clever timber
#

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

cunning plank
#

Can you give me the event id of that latest checkout.session.completed please?

clever timber
#

evt_1KqpnrQSv5bgTx2G2LWkrnvm

cunning plank
#

Perfect, let me look at it closer

#

BRIANCAMELI882B Dos this make sense to you as your local listener PC name?

clever timber
#

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

cunning plank
#

To clarify, where do you see this?

is being returned a 500 error

clever timber
#

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.

cunning plank
#

I think there are multiple thing mixed up and I am trying to get you clear about it

#

But it has nothing to do with the CLI

#

Seemingly it wasn't sent to the listening CLI

clever timber
#

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 ๐Ÿ™‚

cunning plank
#

I know it's draining your time, apology, but debugging is the fastest way to get through it. It's development in the end :/

clever timber
#

Not development for us ๐Ÿ™‚ it's debugging Stripe tools it seems.

cunning plank
#

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

clever timber
#

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?

cunning plank
clever timber
#

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

cunning plank
#

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

clever timber
#

Ok. Then what are the differences? Clearly something is off.

cunning plank
#

I am going to try a Checkout Session

clever timber
#

OK. Let me know what happens...

cunning plank
#

Here, it's working on my end

#

That's a Checkout Session completed on a Standard Connected Account's Direct Charge

clever timber
#

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?

cunning plank
#

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)

clever timber
#

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.

cunning plank
#

hat could cause problems with our database if it gets processed
Recommend to check the livemode parameter 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

clever timber
#

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?

cunning plank
#

Sure upgradding it

#

I was using 1.8.3

#

ugradding to 1.8.6

clever timber
#

OK. We will get 1.8.3 and test if 1.8.6 doesn't work for you

cunning plank
#

1.8.6, listen and forward normally to localhost, triggered a Checkout Session, direct charge, to an Express connected account

clever timber
#

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?

cunning plank
#

because normal forward should also forward both normal and connect events, like my colleague said

#

I am going to try forward-connect-to

clever timber
#

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?

cunning plank
#

yeah normal is the master account (platform account). I am adding that application fee setting to try again

clever timber
#

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

cunning plank
#

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?

clever timber
#

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

cunning plank
#

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

clever timber
#

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

cunning plank
clever timber
#

No. Not that one. Maybe we didn;t send a screenshot but we've already upgraded and tested multiple times. Thanks again

cunning plank
#

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