#eloy-muniz_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1228417834158260335
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Sorry i mean payment_intent_sucessed
succeeded*
Event order isn't guaranteed
Is this a subscription checkout session or one-time payment?
one-time
Another question: Where can I get the product ID? I need to differentiate one product from another.
after the customer purchases the product.
If it's one-time then you'll need to get it from the checkout session. So when you receive payment_intent.succeeded, you can list checkout sessions by that payment intent id: https://docs.stripe.com/api/checkout/sessions/list#list_checkout_sessions-payment_intent. You'll need to expand: https://docs.stripe.com/expand the line_items param since it isn't expanded by default: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-line_items. It'll be in there. You could also listen for checkout_session.completed, but you'd need to make a retrieve checkout session api call anyway when listening to that event since line_items wouldn't be expanded. So, I just recommend listening to payment_intent.succeeded
Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Cool!And about my last question
"Where can I get the product ID? I need to differentiate one product from another.
after the customer purchases the product."
ah ok
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
My last question: Can I place metadata within the payment_intent_succeeded object? If so, where do I put it?