#ariod
1 messages ยท Page 1 of 1 (latest)
If I run the app preview under account X, and I set up a connect webhook in that account, will the app receive those webhooks if I set up the CLI redirection using the --forward-connect-to flag?
AFAIK, yes
What should be the URL of the connected webhook in the Stripe dashboard, though? The localhost URL? Does it matter if it's going to be redirected through the CLI anyway?
you wouldn't create a URL in the dashboard
you just run stripe listen --forward-connect-to=locahost:<port>/my_endpoint for instance, and any events that happen on connected accounts of the account you are logged into stripe-cli with will be sent to that localhost endpoint
Yeah, I am not seeing any events in the CLI when I create a customer. I'm running:
stripe listen --events customer.created --forward-connect-to localhost:3333/api/v1/events
And I created a customer under the account that is running the app preview.
what's the customer ID cus_xxx created?
cus_NBc1jEBiZvhTjm
that customer is created on your platform account, so it's normal it wouldn't have the event sent to a Connect endpoint
if you create the customer on a connected account of your platform with the Stripe-Account header, (https://stripe.com/docs/stripe-apps/build-backend#using-stripe-apis) then the resultant event is sent to Connect endpoints set up on your platform account like that
I see. So going back to the original question, it seems that we cannot test a connected event without triggering it from another account? If I am running the app preview under account X, I need to trigger customer creation on account Y (assuming it's a connected account)?
well you could just do --forward-to to get events happening on your main platform account
True, but the payload is not exactly the same as on the connected account. For example, the account property is missing.
unfortunately I only really know about Connect, I haven't had a chance to get up to speed on how Stripe Apps work
true!
Ok, thank you.
Corect, yes. And installing a Stripe App on an account during testing that's not the publisher of the app is not something that's currently supported (but it's coming soon: https://stripe.com/docs/stripe-apps/test-app)
I guess if you're only interested in webhook event payloads at this stage, have you tried triggering the relevant event on a connected account?
i.e. establish a Connect relationship between the platform (the publishing account) and another account (the account installing the app), and then trigger the event
As that essentially replicates the Connect relationship that's established during the Stripe App installation
Obviously you won't have the actual Stripe App in the Dashboard of the account
Obviously you won't have the actual Stripe App in the Dashboard of the account
Could you please explain this bit?
Correct me if I am wrong, but to establish the connect relationship, I would need to upload the app to the publishing account, and then install that version of the app to a child account.
Then I would use the Stripe CLI to log in to the publishing account (if not logged in already), and listen for connected events.
Well, you can't establish a Connect relationship via the app installation as that doesn't work currently (it's in beta, see link above)
You'd need to establish a Connect relationship via other means, like Account Links or OAuth
I'm not sure what the availability is of that beta, maybe its already on your account. Did you try and follow the steps at the link?
Yes, we can create the connect relationship - I'm just trying to wrap my head around how this whole thing will work end-to-end. ๐
From what I can see, there is no way of running the app preview at the same time, right?
The Stripe CLI needs to be logged in to the publishing account (so we can reroute events), while I want the app preview to be running in the child account, so that I can trigger events as I use the child account's dashboard (and have the app preview on the right).
From what I can see, there is no way of running the app preview at the same time, right?
I don't know what you mean
Did you read the steps here: https://stripe.com/docs/stripe-apps/test-app ?
Are the steps possible/enabled in the Dashboard of the publishing account?
Yes, it's possible. We can use this feature.
Then you just need to follow those steps, and everything should work as you need with the CLI
Forgot about the Connect relationship โ installing the test app will create that
Ok. Also, if the publishing account already has an app in production - setting up the CLI listener will get all of production events, right?