#dan1106_apps-webhook
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/1289295475739983915
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
@fallen quest There are many ways to use and test Stripe Apps. Can you give me a lot more background around how you integrate, which doc you follow, how you are testing on a real connected account, etc.?
Can you also share an exact Event id that isn't working the way you expect?
I'm using Stripe APIs with a "Platform Key" (along the lines of this guide: https://docs.stripe.com/stripe-apps/build-backend#using-stripe-apis)
In this case, I have an extension that is local that I'm running via stripe apps start --manifest stripe-app.dev.json with an app ID that is associated with an account acct_1IfGs2KHtUMqOYFU
dan1106_apps-webhook
I'm using that account acct_1IfGs2KHtUMqOYFU in test mode with the app available in that account via the installation flow in stripe apps start
in order to develop and test the receipt of webhooks on my local dev server, I need to receive Connect webhook events not account webhook events, because when my app is eventually made available through the app marketplace I will be receiving Connect webhook events
this guide makes me thing I need to trigger the test webhook events on a connected account (when I trigger the test events on acct_1IfGs2KHtUMqOYFU I don't get the account field populated on the webhook event) https://docs.stripe.com/connect/webhooks#test-webhooks-locally
for example this event I created from the CLI evt_3Q3VEuKHtUMqOYFU0wELYCwQ which does not have an account field
so I went through these steps:
- From the dashboard for
acct_1IfGs2KHtUMqOYFUI created a new connect account - I went through the test verification steps
- The new, connected account is
acct_1Q3W5yGfrzfb7Jof - I created a test customer in the test connected account
cus_QvMqTWzSvF9Gxm
When I opened the test connected customer through the connect dashboard (i.e. https://dashboard.stripe.com/test/connect/accounts/acct_1Q3W5yGfrzfb7Jof/customers/cus_QvMqTWzSvF9Gxm) my Stripe App ContextView loads next to the customer record, but the value of extensionContext.userContext.account.id was acct_1IfGs2KHtUMqOYFU (the parent account) not acct_1Q3W5yGfrzfb7Jof (the connected account) as I would have expected
which led me to the question of whether that's expected, and if it is, if it's possible in my ContextView to get the account Id of the account being viewed? And if not, can I prevent my view from being shown.
Thanks for all the details. @unreal shale is taking over and is going to help you with this but give them a bit of time to catch up
It looks like your question is unrelated to webhooks right now
And then how to test a webhook event from the connected account on my local server
Thanks @red orchid -- yes, it's only partially about webhooks, it's mostly about development flows for Stripe Apps
@unreal shale hopefully that explanation is clear, but let me know if there's anything it would be useful for me to try to explain more clearly!
This seems to be confusing together two different things.
my Stripe App ContextView loads next to the customer record, but the value of extensionContext.userContext.account.id was acct_1IfGs2KHtUMqOYFU (the parent account) not acct_1Q3W5yGfrzfb7Jof (the connected account) as I would have expected
This is something apart from the webhook events on your Connect endpoint and theaccountattribute.
When using theacct_1Q3W5yGfrzfb7Jofconnected account, are actions producing the expected webhook events to your platform connect endpoint?
ah sorry, yeah, there are two separate issues:
- How to correctly get app context in connected accounts
- The correct way to test App webhook endpoints locally
I think the issue here is you're fundamentally using the dashboard as your platform, not a connected account
https://dashboard.stripe.com/test/connect/accounts/acct_1Q3W5yGfrzfb7Jof/customers/cus_QvMqTWzSvF9Gxm
This URL tells me you're doing some kind of "view as connected account" access which I don't think will work like you expect
That makes sense, which I think raises a couple of questions:
- Is there a way to prevent my app from being installed/running on Connect accounts (because, like you say, an app won't work as expected if it's installed on a Connect account and then run in the nested connected account view, because the context will have the connect account id, and the customer ID from the connected account and those are mismatched)
- Should I not be using the connected account features to create test accounts to generate test webhooks for the App that is installed on the Platform account? If not, how should I be testing webhooks?
taking a step back, there are two things I'm trying to achieve:
- A testing workflow during local dev for 'Connected Account' Webhooks that mirrors the events my app will receive once it's installed via the marketplace
- A way to view my development version of my app in the end user account that is generating those test webhook events
1/ I don't think so, and you likely don't want to. Platforms can have their own customers too (say, for destination charges) so there are valid use cases.
2/ You should create an entirely separate account (in the dashboard, using the account siwtch, create a new account) and you can allow a limited number of other accounts to install your app in test mode as an "external test":
https://docs.stripe.com/stripe-apps/test-app#set-up-test
eg, your platform P has connected accounts CAA and CAB. YOu need to create a new Stripe account Q that is unassociated with your platform, and then invite yourself on that account to your external test
1/ For a Platform account, it's ok if the Platform has customers/charges (i.e. customers of P), but hopefully there's a way to prevent my ContextView showing for customers of CAA and CAB viewed while logged into account P? Because my backend calls will fail as they come from account P, but I can't use the API to retrieve a customer record for CAA by specifying account ID P. (Or I need a way in the ContextView to get the ID of the account ID of CAA and not P?)
2/ OK, that makes sense. It's a bit unfortunate because it breaks the stripe apps start development flow where development is local and everything hot reloads. I'll need to upload a version of my app, and as my app changes reupload it, change the test version, and keep reinstalling it etc.
does that first question make sense?
1/ I can't see any way to detect this scenario
2/ Yea, I agree its a little cumbersome
I think both of these are both great piece of feedback for the Apps team. They recommend here to reach our via their github repo for feedback, which i think would be a good place to share this detailed example/usecase.
https://docs.stripe.com/stripe-apps#support-and-troubleshooting
ok, thanks for your help and thinking through this with me, I'll share some feedback