#ShubhamDev
1 messages · Page 1 of 1 (latest)
Hi there!
I'm not sure I understand your question. Can you clarify what you are trying to do?
Once Payment is succeed, How we can capture the response?
I had created a webhook endpoint by webhook.site url. Now I want to capture the response as an api.
How we can capture the response?
What does this mean? You want to be notified when the PaymentIntent is successfull? If so, you need to listen topayment_intent.succeededwebhook event. And you can learn more about webhooks here: https://stripe.com/docs/webhooks/quickstart
I am passing the metadata while creating the subscription. But I am not getting the metadata response once payment is succeed, Could you please help me how to get metadata details after payment successfull ?
I'm guessing the metadata is on the subscription object, not the PaymentIntent. So on the PaymentIntent object, find the invoice property. And then on the Invoice object, find the subscription property. And then on the subscription you'll find the metadata.
Also you could directly listen to invoice.paid instead of payment_intent.succeeded
This way you can direclty look at the subscription property to find the subscription ID.
We are using subscription create api for creating the client secret, this client secret is using for the payment completion from the frontend, from there only we are creating the payment intent, If we want to add metadata to the payment intent, Do we need to use create payment intent api for subscription flow?
from there only we are creating the payment intent,
You don't create the PaymentIntent. When you create the subscription, it automatically contains an invoice with a PaymentIntent and a client_secret.
If we want to metadata to the payment intent, Do we need to use create payment intent api for subscription flow?
No, if you want to add metadata to the PaymentIntent of the subscription, you just need to update the existing PaymentIntent with the metadata you want. You could lisent to thepayment_intent.createdevent to know when a new PaymentIntent was created.