#mhassaan
1 messages ยท Page 1 of 1 (latest)
Hi, are you able to share more context here?
@tidal aurora - created this thread for us
https://stripe.com/docs/api/events/types#event_types-checkout.session.completed
Can I get more information about when this event is triggered? Is it triggered when the payment is successful and the user is done?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Moving the last bit to this thread
sure, i have one main stripe account, using this main account i create subscriptions and payment links in the connected accounts. Now on successfull checkout session i receive webhook events, if the payment link that i used to pay belongs to patoform account then i receive the events susccessfully, however if payment link belongs to connected account then i receive Webhook signature verification failed. error. I assume that this error is because i am using whsec from main account only.
yes, this event occurs when the Checkout Session is successfully completed.
I see, your assumption sounds correct. To learn more about connect webhooks, please visit: https://stripe.com/docs/connect/webhooks and https://stripe.com/docs/webhooks/signatures
https://mysite/webhooks gives me one sec for main account , i want to use the same URL for connected account which would give me second secret, my question is how would i be able to determine inside code which secret to use ?
Actually, can you share the Event id with me please?
you mean events i am listening to or actual event_id recieved on receiving webhook?
The event id that is seeing this error.
just give me sometime and i get back to you
evt_1LiOrFGvzOPd2uKlnrSsiQbK
belongs to checkout.session.completed
Thank you, taking a look here
It appears that you have both of the secret keys in the Stripe-Signature on that request so that will not work as it has to exactly match the secret key shown in the Dashboard.
Can you confirm that you're seeking to use the same URL for both the platform account and the connected account? You're wondering how to achieve this with the signature verification piece. Is that correct?
exactly you got it right
i am wondering how to play with this signature verification stuff for these two different keys on the same URL
(as a User) I use two separate routes for /direct and /connect - they go to the same handler (as express structure), and the Express route differentiates so I can use the separate secrets...
happy to share node/JS code, if you want
๐ stepping in for pgskc
As GigStartr noted, you want two different endpoints here
i agree, using two different routes can be the solution. also i was wondering i could decide based on presence of account params in the response, something like this
if account
webhook_secret = ENV["webhook_secret_connected"]
else
webhook_secret = ENV["webhook_secret_direct"]
end
No that doesn't work since you construct the event based on the raw request body