#dan1106_apps-webhook

1 messages ¡ Page 1 of 1 (latest)

queen jettyBOT
#

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

red orchid
#

@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?

fallen quest
#

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

red orchid
#

dan1106_apps-webhook

fallen quest
#

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

queen jettyBOT
fallen quest
#

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_1IfGs2KHtUMqOYFU I 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
#

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.

red orchid
#

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

fallen quest
#

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!

unreal shale
#

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 the account attribute.
When using the acct_1Q3W5yGfrzfb7Jof connected account, are actions producing the expected webhook events to your platform connect endpoint?

fallen quest
#

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
unreal shale
#

I think the issue here is you're fundamentally using the dashboard as your platform, not a connected account

fallen quest
#

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
unreal shale
#

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

Set up and distribute test versions of your app before publication.

#

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

fallen quest
#

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.

fallen quest
#

does that first question make sense?

unreal shale
#

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

fallen quest
#

ok, thanks for your help and thinking through this with me, I'll share some feedback