#pawanjoshi
1 messages · Page 1 of 1 (latest)
What is the issue ?
I expect to receive the metadata info I sent in the request inlcluded in the webhook post by stripe.
Can you share the eventId you are referring to ?
okay. I think problem is not there.
I have added a event for webhook
charge.succeeded in this event I am not getting the metadata, but in checkout.session.completed event I am getting it all fine.
Correct.
how can I pair the webhook endpoint to a specific request type.
for example I have two routes one to handle subscription and another to handle one time payments.
I want to use separate webhook routes for both, but on the same event checkout.session.completed.
how I can achieve that?
or can I use checkout.async.session.completed for one time payment, will it work without any issue?
You can't achieve that, webhook endpoint can be splitted by event types. As you are using Checkout Session for both cases you can't distinguish that on endpoint level, but you can filter on the webhook event body of the Checkout object:
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-subscription
or check the payment mode
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-mode
okay thanks. and if i use the event
checkout.session.async_payment_succeeded
will it work the same as I won't need to use any filter then?
No that event is for async payment methods (like bank debits)
okay.
Hi! I'm taking over my colleague. Please, let me know if you have any other questions.
yes is there any other webhook event besides checkout.session.completed where I can receive the payment completed info alongwith metadata sent to stripe?
Where is your metadata stored?
Basically you can access any related object by making API calls with only the data sent by checkout.session.completed
You can access PaymentIntent, Charge, or Customer by calling the respective endpoint
so this is the response I get.