#tom_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/1410892558342553722
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! the checkout.session.completed doesn't have line_items expanded by default. So what you can do is to make another request to retrieve the Checkout Session, and expand line_items : https://docs.stripe.com/api/expanding_objects
On a related note, you would also want to keep in mind that delayed payment methods generate a checkout.session.async_payment_succeeded event when payment succeeds later, and you shouldn't solely rely on checkout.session.completed if you also have delayed payment methods. https://docs.stripe.com/checkout/fulfillment?payment-ui=stripe-hosted#immediate-versus-delayed-payment-methods
Ah great! So I need a webhook on checkout.session.async_payment_succeeded and checkout.session.completed. In it, I receive a succeeded cs_ request. And on our side, with the SDK, i can see which products are in it with https://docs.stripe.com/api/checkout/sessions/line_items. I can see that work! ๐
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
in that fulfilment guide i shared, it does share some example code to check if order fulfillment (in your case, email) should be performed for both events. The key part would be
# Check the Checkout Session's payment_status property
# to determine if fulfillment should be performed
if checkout_session.payment_status != 'unpaid'
# TODO: Perform fulfillment of the line items
Thanks Alex. I think I know enough for now.