#dishant_cli-connect-events
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/1282670648984076483
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi
hi! can you say more? what exact command are you running, what sort of events are you expecting?
In cmd I am using stripe listen --forard-to 'locally created enpoint url'
I am expecting
- charge.succeeded
- charge.updated
- charge.failed
- payment_intent.succeeded, etc..
Whatever event stripe is throwing to the webhook end point.
Later using code I will filter the events
do you have an example of a ch_xxx Charge ID that you expect to be seeing? How do you create the test events?
I place the payment to stripe and using separate project which is listening to webhook events I am testing the events
maybe your "separate project" is using the API keys of a different Stripe account than the one stripe-cli is using?
pi_3Px65TBYB6ebuc8B1l80aIcc
this is the payment which I placed just 5 min ago
ah this is a Connect payment, right? you're using Connect with Direct Charges?
Yes
Earlier this is working fine in local host
but now it is only throwing application_fee.created event
you need to use --forward-connect-to <url>
https://docs.stripe.com/cli/listen#listen-forward-connect-to
https://docs.stripe.com/connect/webhooks#:~:text=Note-,For Connect webhooks,-%2C use –forward-connect
ohhkk
When this update came?
not sure what you mean, there's no update or anything new here
this --forward-connect-to is not working for me, I think because my webhook end point is created into platform account
--forward-to should be working as earlier
the way you do this normally is you use stripe login to connect stripe-cli to your platform account, and then you can use --forward-connect-to to listen to events that happen on your connected accounts(like events relating to payments processed as Direct Charges)
but that --forward-connect-to is actually not working for me
I used** stripe login --api-key 'key'**
then** stripe listen --forward-to 'endpoint url'**
Is that okay?
when you say "not working" what does that mean?
It means it is not calling my webhook endpoint which was working with --forward-to
As I told you I created one separated azure function code which is handling my webhook events
I mean it really depends what "key" is , is it your platform key, the key of a connected account , something else...
I told you the supported/recommended way of doing this : you use stripe login to connect stripe-cli to your platform account, and then you can use --forward-connect-to to listen to events that happen on your connected accounts(like events relating to payments processed as Direct Charges)
this way also I am getting only one event same as earlier
What could be the cause of this only one event trigger when payment made to stripe?
if you're only getting application_fee.created it's because you're running on the platform account and only listening to events that happen on the platform account(--forward-to), which is why you need to listen to Connect events via --forward-connect-to
not sure, I've never created a restricted key this way to use with stripe-cli. Can't you just use stripe login , copy the link, open the link in your browser where you're logged into your platform account, and accept? I'd recommend that.
I did the same
And that created this key
I used stripe login
the authorized from the link then did the stripe listen
cool
so now if you run stripe listen --forward-connect-to=<url> , leave that Terminal window open; then go do some test payments on a connected account, what happens?
also if you do stripe config --list what is the value of account_id
the platform's account id I am getting
and what ID acct_xxx is that exactly?
acct_19WmAUFe0vn1lMmX
sounds good. So now if you run stripe listen --forward-connect-to=<url> , leave that Terminal window open; then go do some test payments on a connected account, what happens?
and share the ID pi_xxx of the test payment you create
I tried and it is not hitting the separate code I created to listen webhook events which is azure function code
Hi there 👋 jumping in as my teammate needs to step away soon. Can you elaborate on what that means? Do you see the additional events being received in the CLI's output, and they just aren't being sent where you're hoping they will be?
Hi @wintry ridge
So the issue is I am running CLI in local machine and it is only hitting for application_fee.created event
no other events like charge.succeeded, charge.updated, etc..
which is working fine earlier with the same code which I have right now
To break this down a bit more, Events that are important for a Platform appear in one of two places. Either directly on the Platform account, or they are generated on a related Connected Account.
forward-to only forwards events for your account (the platform) you have to also use forward-connect-to in order to forward the Events from your Connected Accounts as well.
https://docs.stripe.com/cli/listen#listen-forward-connect-to
I only got this
What is the exact command you're using to start stripe listen?
That's because you aren't using forward-connect-to as well as forward-to
When I use the forward-connect-to
it is actully not hitting my local host endpoint
Can you show me that? Run stripe listen --forward-to [your_endpoint] --forward-connect-to [your_endpoint] and then make a test payment
Sure above screen shot is with --forward-to [endpoint]
here is with -connect
and as you can see it does not have the [200] ok result because it does not hit the endpoint which I created
Can you try again with both options as I suggested above? Can you also share the ID of the Payment Intent when you try that
pi_3Px6vKBYB6ebuc8B1sKzagE8
with --forward-to
pi_3Px7BDBYB6ebuc8B1yIkRbJv
with --forward-connect-to
I don't understand why you're pairing them with only one option. Are you running stripe listen with both forward-to and forward-connect-to options?
Yes
Am I doing something wrong here?
If yes then what is the correct way pls tell me
So far all of the screenshots you've shared show you only using one option (only forward-to or only forward-connect-to) when running stripe listen. You should use both of them simultaneously. Like this:
stripe listen --forward-to [your_endpoint] --forward-connect-to [your_endpoint]
With that also I am getting only one event in my code
Now I need the Payment Intent ID from that test ^
pi_3Px7IzBYB6ebuc8B0o1OBXqw
Thank you, let me take a look there.
yes please
And triple checking, you ran listen before making the confirmation request?
I'm asking you more questions about what you're doing so I can try to spot what is going on. Part of your flow is to confirm a Payment Intent, like you did in this request:
https://dashboard.stripe.com/test/logs/req_u54YWRKZ46VpOw
I'm making sure that you had run stripe listen in your terminal before you made that confirmation request?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
it's because the account is only connected in live mode, not test, so test mode events don't get delivered. We'd recommend testing with fully test-mode accounts, not making test mode requests on live accounts.
you can technically also connect the account in test mode as well (by doing https://docs.stripe.com/connect/oauth-standard-accounts using your test mode ca_xxx client ID) but it's quite tricky and you'd need the owner of the connected account to agree.
It's easier to just use a regular test account you create.
Great spot!
Okay that means I have to try the account which is integrated into test as well as live mode
Is that correct?
Yup
I can try this and let you know
Thank you for your help @daring berry & @wintry ridge
Is there anyway that I can convert live to test acocunt?
No. An account that can operate in livemode can also operate in testmode, there isn't a conversion that needs to happen.
okay but for this case I need an acocunt which is available in both, Right?
The account is already available in both, the problem is that the Connected Account is only connected to your Platform in one mode.
You'll either want to use/create a Connected Account using your testmode API key from your Platform account, or use the approach my teammate mentioned in their message above.