#tryhardeng_webhooks
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/1446549500419375104
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ Can you clarify how you are using Stripe Listen? This can be used to forward events locally, not just those triggered by the CLI but also those triggered by events from your integration.
You would want to make sure you are logged into the CLI from your sandbox account. It's going to forward Webhook events from the account the CLI is currently logged in to.
Yeah exactly. For example, in my sandbox, I have this destination:
http://dev.awsinstance.com/api/v1/webhook-events/stripe
In dev, if I join to my frontend app, and I create an account, I have a button called "Connect Stripe Account", and I use the SDK with the publick key I think so, to get the onboarding url.
Ok, everything works perfect in dev env. But now in local env, I have my:
Frontend in localhost.
Backend in localhost.
So, my url for receive events in localhost are:
http://localhost:8000/api/v1/webhook-events/stripe
So I run stripe listen --forward-to http://localhost:8000/api/v1/webhook-events/stripe/connected-accounts/
And this return me a signin secret, that I replace in my .env
I run stripe login before, but let me try again
Oooh
I think I see the problem
When I run "stripe login" the first time
I select "Test mode"
Instead of "<appname> sandbox "
Could be that right?
Becase Yeah, Yesterday I selected Test mode, instead of <app> sandbox ...
That's at least part of the problem.
I also believe you only need to run
stripe listen --forward-to localhost:8000
not the full url?
correct. That way say, you have multiple webhook endpoints that listen to different events. It will forward them accordingly
Say you have two webhook endpoints.
www.example.com/api/v1/webhook-events/stripe/connected-accounts/
www.example.com/api/v1/webhook-events/stripe/platform/
and you run stripe listen --forward-to localhost:8000
Events you listen to on /connected-account will get forwarded there and events you listen to on /platform will be forwarded there.
Ok, got it.
But even if I run localhost:8000, I have something wrong or I'm doing something wrong.. I need read the docs more detailed
Because I'm not sure if do this:
No nvm
what event is it you are listening for?
That's the problem haha is my first time using this setup and project. (I'm newin the company, but I'm trying understand stripe).
They have a button "Connect to stripe".
This button open a sandbox url stripe, where you can use a "test account", and I can configure fake number, etc.
They use the stripe secret key in the client side, the key that starts with "sk_test_..." this one is the same that we using in sandbox.
Well, what I'm waiting is receive the event when you click that button, and confirm the account. I think the event should be received in my localhost, but what I'm seeing, is that in events in stripe dashboard sandbox, I'm not seeing that event
I'm not sure if is related because I tried use that same account in dev env before,
Idk, is weird, let me continue checking.
I mean this onboarding
In dev env, where is running the current sandbox setup, the backend receive that event and we configure the data from stripe for that account in our system
What I'm trying do is do the same stuff but for local, that's all haha
I was going to try ngrok, but I read about stripe listen, so I think is better option
Just I need figure out what is happening:/
Is maybe because I already have the "connected account"?
When I "connected" the account with same gmail but in dev env?
Because I'm checking in dashboard in sandbox the connected accounts, and I see my email when I test in dev env, not in my local env. So I'm not sure is that
do you know what I mean?
(english is not my first language, sorry).
do you have the id of the webhook endpoint handy?
We have two types of endpoints you can create. The standard endpoint that will recieve events that happened directly on your platform, and connect endpoints that will receive events happening on your connected platforms. Whenever in doubt, where it would end up, you can check the dashboard if you see the events on your platforms event logs those events would show up on the standard endpoint, if it's showing up in the dashboard logs of the connected account those events would get routed to the connect endpoint.
No need to apologizes. ๐
Yeah, before send you the ID, could be that the problem? that I'm using the same email that I used in dev env
And now in local env, when I type same email in the onboarding
Stripe detect the exists an connected account and I don't receive the event
you can have multiple accounts registered to the same email address so I don't believe that's the issue here
ok, let me share you the id
this is our destination IDS for dev env:
we_1SaEZVPqwSINQbc3vfUTXESf
we_1SNBmhPqwSINQbc36T56jADl
Are 2, one handle all the payments stuff
the other one handles all the connect stuff
That works perfectly in dev env (I mean, running my local host frontend and using the dev backend instance, not local instance for developing).
We have that dev env for the frontend guys practically
But in my case as backend dev, I want to test the frontend also but pointing to my backend instance, that's what I'm trying.
And if I go to events, I don't see any event related with the connect stuff
to clarify you are trying to listen to the v2.core.account_link.returned event?
To be honest, I'm not sure how is called, let me check, I thought the event was account.external_account.created
account.external_account.created is for when an external account aka a card or bank account is added to an account.
The method is account.updated
I just tested with some other email again in dev env
And I see the events like account.updated, capability.updated
yeah, I tested and I think I see the problem @pearl jasper
If I use same account that was already connected before, I don't receive the event.
What I mean?
- I'm in dev env. I create some account with emailone@gmail.com
- I go to connect stripe
- Stripe onboarding allow me select some test data.
- Stripe take the param of the email, in this case emailone@gmail.com
- I finish the config
- I receive the event in my server
Now,
- Signout in my dev web app
- Create ne account now with emailtwo@gmail.com
- I go to connect stripe
- Stripe onboarding allow me select some test data
- Stripe take the param of the email, but in this case I use the same emailone@gmail.com
- I finish the config
- I got redirect to my web app
- I didn't have the event to connect the account
More less
And this happening in local because, in dev I use:
Then in local intsance, I use the same email
https://dashboard.stripe.com/acct_1RGxF0PqwSINQbc3/test/webhooks/we_1SNBmhPqwSINQbc36T56jADl/
looks like this endpoint exists on the test-mode of acct_1RGxF0PqwSINQbc3
Is just a theory, because in dev, my account wasn't connect, seems like a bug maybe
do you have an endpoint set up on your sandbox?
whats your sandbox account id?
I just want to confirm we are talking about the same account and Webhook Endpoints
Mmm no no, sorry for take your time. I will read docs, I need understand wtf is happening.
If I don't understand that I cannot ask well.
Sorry:/
And you right, I can use the same stripe account
To connect it to different accounts in my system
My bad.
No worries! Feel free to read over.
If you have more questions and reach back out. I'd suggest starting by providing the sandbox account id you are testing with and the id of the Webhook endpoint you are expecting the events to arrive to so we can get a clear picture.
I sent you the webhook dstinations Id before
Is this ones:
we_1SaEZVPqwSINQbc3vfUTXESf
we_1SNBmhPqwSINQbc36T56jADl
And the sanbox account id, let me see where see it.
Correct, i'm saying if you come back later. it will be a new thread. While we can look back at old threads it' helps to have account ids and endpoint id's up front at the start ๐