#Dara

1 messages · Page 1 of 1 (latest)

jovial prismBOT
opal hare
#

When you forwarded you specify the URL with query parameter?

#

What do you see on console then

remote haven
#

No, I just use this command:
stripe listen -p shadowness -a -f localhost:5000

#

I set the url query in the webhook endpoint on the dashboard

opal hare
#

That will use the Stripe CLI instance (the one on your local machine) to listen to the event from Stripe and directly forward to localhost:5000. It is unrelated to anything set on Dashboard

remote haven
#

Really? I thought that it just changes the domain to localhost. All my webhooks are ran from events.

#

Actually, it is related to the dashboard because -a means load from webhooks.

opal hare
#

Oh sorry missed that part

remote haven
#

So we have 2 Stripe accounts and to know which one it comes from, I was recommanded by Stripe developers here to add a query to the webhook endpoint url.

opal hare
#

Hmm you have one endpoint URL for 2 different account?

#

Are they both regular account or connected account?

#

It's a strange setup though, normally you would want to separate them

remote haven
#

regular accounts

#

Yes, same endpoint for both accounts because it's 1 database.

opal hare
#

but yes using query parameter should word. How about testing it without the stripe listen command

#

Just stripe trigger on each account and see

remote haven
#

stripe trigger is just fake data right?

opal hare
#

Yes.

#

Well you can trigger real data via your site, but really not that much different

#

for Test mode

remote haven
#

Trigger failed: Request failed, status=401, body={
"error": {
"code": "api_key_expired",
"doc_url": "https://stripe.com/docs/error-codes/api-key-expired",
"message": "Expired API Key provided: rk_test_*********************************************************************************************QvhcBB",
"type": "invalid_request_error"
}
}

Learn more about error codes and how to resolve them.

#

I never used the trigger command...

#

Oups, I forgot to add the project -p. The trigger works now.

#

trigger doesn't do anything. My server doesn't receive the webhook without the listen command.

#

Forget it. I think I'll add a metadata to the subscripton for new subscribers.

#

On the listen terminal, the post address is without the query...

opal hare
#

trigger doesn't do anything. My server doesn't receive the webhook without the listen command.
Why? In a real-world application you wouldn't need listen to receive event

#

Happy to quick check if you provide the event id evt_xxx

remote haven
#

Well, I trigger this one "evt_1NEMH74ugWOxILKl2djSJglE" for customer.subscription.created.

remote haven
# opal hare > trigger doesn't do anything. My server doesn't receive the webhook without the...

Not true, when a user subscribes either through element or checkout, the event customer.subscription.created is triggered first but the status=incomplete. Then, customer.subscription.updated is triggered to change the status from incomplete to active. So 2 webhooks will run in this case. Also, if Stripe or the server was interrupted in anyway, webhooks is the best method to deal with this. In the past, wihtout the webhooks, our support was bombarded for not fulfilling our customers during an outage. And we had to remedy manually. With webhooks, you just have to wait until the events get resent.

opal hare
#

Sorry I don't really follow, what is not true? I meant in your running service, you don't rely to stripe listen on the terminal to receive every event, correct?