#sarim-webhook-connect

1 messages ยท Page 1 of 1 (latest)

rancid trench
#

@night ruin if by "key" you mean the endpoint secret then it's the same I think

night ruin
#

ok then how stripe can recognised which endpoint going to call either direct or connect because key is same for both

rancid trench
#

it's not a key

#

the CLI knows how to detect which endpoint this is for

#

Easiest is really to just try in Test mode and see what happens to get a real understanding of it

night ruin
#

ok one more time in my application.properties file i have 2 signature one for connect and one for direct so when i am going to test direct webhook endpoint in my app i just place secret-key with stripe.direct-signature value that stripe provides in his dashboard and its working fine but when i am going to call connect so again the secret is same then how stripe get its connect call or direct call that is my confusion right now

rancid trench
#

I'm sorry you're saying partly the same work and keep talking about a secret key

#

the Secret API key is sk_test_123. It's used to make API requests. It's completely different from the webhook endpoint's signing secret (not secret key) whsec_123

#

If you use the CLI, the CLI will generate a different signing secret and you use the CLI one when debugging with it

#

Does that make sense?

night ruin
#

ok let me clarify when i am using this command ./stripe listen --forward-to localhost:8080/webhook/direct stripe generate like Your webhook signing secret is whsec_4f7.... something and when i am going to call Webhook.constructEvent this method requires secret as a last parameter So you mean its same for both connect and direct endpoint ??

#

then why stripe dashboard provide separate keys for direct and connect ? is it make sense ?

rancid trench
#

yes, it's the global signing secret for the CLI

#

This is all test mode. To the CLI it's all one endpoint

#

in production, you have 2 separate endpoints, each with their own signing secret

#

but if you go through the CLI it's handled differently

night ruin
#

alright now i am understand and stripe is automatically recognised which event goes to which endpoint right ?

rancid trench
#

that part I'm not sure, I haven't tested this recently so the best option is to test this quickly to confirm

night ruin
rancid trench
#

Happy to help ๐Ÿ™‚

night ruin
#

๐Ÿ™‚

#

let me try thanks

night ruin
#

its working fine thanks dude